<Menuname><title>Meal Type</title>
<submenu><title>Starters</title></submenu>
<submenu><title>soups</title>
<subsubmenu cuisine="American" popularity="5" difficulty="easy" quickmeal="Cookingtime(0-30 minutes)" >
<title>French Onion Soup</title>
<ingredients>
2 teaspoons olive oil
6 onions,thinly sliced
1 teaspoon sugar
3 cups water
1/4 teaspoon salt
1/4 teaspoon black pepper
4 slices French bread,toasted
1/4 cup shredded Gruyère cheese </ingredients>
<recipe>
Heat oil in Dutch oven or large pot over medium-low heat. Add onions and sprinkle with sugar; cook, stirring frequently, until onions are deep brown.
Add water, broth, salt, and pepper to pot; bring to boil, scraping up browned bits from bottom of pan. Reduce heat and simmer, covered, 20 minutes.
Preheat broiler.
Set 4 flameproof bowls on baking sheet. Ladle soup evenly into bowls. Float 1 slice of bread in each bowl and sprinkle with rounded tablespoon Gruyère. Broil about 5 inches from heat until cheese is melted, about 2 minutes. </recipe>
<FYI>The key to success with this classic soup is to cook the onions very slowly until they have a chance to caramelize, which turns them a deep mahogany color and ensures a rich flavor.</FYI>
</subsubmenu>
</submenu>
<submenu><title>Salads</title></submenu>
<submenu><title>Breakfast</title></submenu>
<submenu><title>Brunch</title></submenu>
<submenu><title>Main Dishes</title></submenu>
<submenu><title>Side Dishes</title></submenu>
<submenu><title>Breads</title></submenu>
<submenu><title>Desserts</title></submenu>
<submenu><title>Drinks</title></submenu>
</Menuname>
<Menuname><title>Cuisine</title>
<submenu><title>American Cuisine</title></submenu>
<submenu><title>Asian Cuisine</title></submenu>
<submenu><title>European Cuisine</title></submenu>
<submenu><title>Britian Cuisine</title></submenu>
<submenu><title>African Cuisine</title></submenu>
</Menuname>
<Menuname><title>Popularity</title>
<submenu><title>1</title></submenu>
<submenu><title>2</title></submenu>
<submenu><title>3</title></submenu>
<submenu><title>4</title></submenu>
<submenu><title>5</title></submenu>
</Menuname>
<Menuname><title>Difficulty</title>
<submenu><title>Easy</title></submenu>
<submenu><title>Medium</title></submenu>
<submenu><title>Hard</title></submenu>
</Menuname>
<Menuname><title>Quickmeals</title>
<submenu><title>Cookingtime(0-30 minutes)</title></submenu>
<submenu><title>Cookingtime(30-60 minutes)</title></submenu>
<submenu><title>Cookingtime(1-2 hours)</title></submenu>
</Menuname>
</Menus>
答案 0 :(得分:0)
你有什么尝试?
您是否已阅读guides和API reference?
总的来说,我认为你从创建TBXML对象开始:
TBXML * tbxml = [[TBXML alloc] initWithXMLFile:@"books.xml"];
然后你可以得到它的根元素:
TBXMLElement root = tbxml.rootXMLElement;
然后查询各种事情:
TBXMLElement * menuname = [TBXML childElementNamed:@"Menuname" parentElement:root];
TBXMLElement * menutTitle = [TBXML childElementNamed:@"title" parentElement:menuname];
NSString *titleString = [TBXML textForElement:menuTitle];
我通过阅读文档来解决这个问题。如果您已经阅读了文档而没有理解它,那么发布您不理解的位(让响应更具体)是有帮助的。如果您还没有阅读文档,那么在发布Stack Overflow之前应该真的这样做了。