XML和XSL没有得到期望的结果

XML和XSL没有得到期望的结果,xml,xslt,Xml,Xslt,我有一个食谱的XML文件。每个配方都是使用一个元素定义的,我的XSL我想使用填充一个表。唯一的问题是我没有得到想要的结果。for-each之外的一切都很好,并且显示了,但是for-each内部的一切都没有出现 我在XSL中没有看到任何错误,但我也不是最擅长创建错误的。任何帮助都将不胜感激 输出: Testing HTML Testing Body Testing Table XML 烧焦的饼干 图片/burntcookie.jpg 120分钟 300分钟 动物饼干 把动物饼干放在平底锅上 把

我有一个食谱的XML文件。每个配方都是使用一个元素定义的,我的XSL我想使用
填充一个表。唯一的问题是我没有得到想要的结果。for-each之外的一切都很好,并且显示了,但是for-each内部的一切都没有出现

我在XSL中没有看到任何错误,但我也不是最擅长创建错误的。任何帮助都将不胜感激

输出:

Testing HTML
Testing Body
Testing Table
XML


烧焦的饼干
图片/burntcookie.jpg
120分钟
300分钟
动物饼干
把动物饼干放在平底锅上
把锅放在烤箱里
... 
利润
美味的黑豆煎饼
图像/
10分钟
15分钟
2(10英寸)面粉玉米饼
2汤匙植物油
1个小洋葱,切碎
1/2红甜椒,切碎
1茶匙蒜茸
1(15盎司)罐装黑豆,冲洗并沥干
1茶匙墨西哥胡椒粉
3盎司奶油奶酪
1/2茶匙盐
2汤匙切碎的新鲜芫荽叶
用箔纸包好玉米粉圆饼,放入加热到350华氏度(175摄氏度)的烤箱中。烤15分钟或直到热透。
在10英寸平底锅中以中火加热油。将洋葱、甜椒、大蒜和墨西哥辣椒放入平底锅,煮2分钟,偶尔搅拌。将豆子倒入平底锅,搅拌3分钟。
将奶油奶酪切成方块,加入盐锅。烹饪2分钟,偶尔搅拌。将芫荽叶搅拌成混合物。
用勺子把混合物均匀地舀到烤好的玉米饼中间,然后把玉米饼卷起来。马上上菜。
奶油芦笋汤
images/aspSoup.jpg
30分钟
30分钟
1/4杯人造黄油
1个洋葱,切碎
3茎芹菜,切碎
3汤匙通用面粉
4杯水
1罐浓缩鸡汤(10.5盎司)
4汤匙鸡汤粉
1个土豆,去皮切丁
1磅新鲜芦笋,切碎
3/4杯半杯
1汤匙酱油
1/4茶匙黑胡椒粉
1/4茶匙磨碎的白胡椒粉
把黄油或人造黄油放在一个沉重的锅里融化。加入洋葱和切碎的芹菜;炒至软,约4分钟。拌入面粉,拌匀。煮约1分钟,不断搅拌。不要烫伤,或者让它结块。加入水、鸡汤和鸡汤底;搅拌至光滑。烧开。加入土豆丁和芦笋碎。降低温度,用文火炖约20分钟。
在食品加工机或搅拌机中分批制作汤泥。回到锅里。
拌入半份奶油、酱油和黑胡椒粉。把汤煮开。根据口味调整调味品。热菜。
胡萝卜蛋糕四
图片/carrottake.jpg
30分钟
30分钟
1(18.5盎司)包装胡萝卜蛋糕混合物
半杯水
1/2杯植物油
3个鸡蛋
1/2杯切碎的核桃
1(8盎司)罐碎菠萝汁
预热烤箱至华氏350度(摄氏175度)。在两个8英寸的圆形平底锅上涂抹油脂和面粉。
在大碗中,混合蛋糕混合物、油、水、不排水的菠萝、鸡蛋和坚果。用电动搅拌器中速搅拌2分钟。把面糊铺在准备好的平底锅里。
烘烤35到40分钟,或者直到插入中心的牙签干净为止。凉的奶油干酪霜。
茄子蔬菜烘焙
图片/egggvegie.jpg
10分钟
35分钟
1汤匙橄榄油
1杯切成两半的西葫芦
3个葱,切碎
1/2甜洋葱,切成薄片
2个罗马(李子)西红柿,切碎
1/2杯鲜蘑菇碎
3杯切碎的小菠菜
1/2柠檬汁
伍斯特郡调味汁
辣酱
大蒜粉
盐和磨碎的黑胡椒调味
1 1/2杯液态鸡蛋替代品
1/4杯切达干酪丝
预热烤箱至华氏350度(摄氏175度)。在8x8英寸的烤盘上喷洒烹饪喷雾。
在平底锅中用中高火加热橄榄油。将西葫芦、葱、洋葱、西红柿、蘑菇和菠菜放入平底锅。撒上柠檬汁、伍斯特沙司和辣酱。用大蒜粉、盐和胡椒调味。煮至变软。转移到准备好的烤盘上。将鸡蛋替代品倒在菜里的蔬菜上。上面加奶酪。
在预热的烤箱中烘焙20分钟,或者直到鸡蛋替代品凝固,奶酪融化。用抹刀切开,尽情享受吧!
鸡肉培根什锦烤肉
图片/ChickenBaconShish.jpg
25分钟
20分钟
1/4杯酱油
1/4杯苹果醋
2汤匙蜂蜜
2汤匙菜籽油
10个大蘑菇,切成两半
2个葱,切碎
3块去皮去骨鸡胸-切成块
1/2磅厚切片培根,切成两半
1(8盎司)罐菠萝块,沥干
串
在一个大碗里,混合酱油、苹果醋、蜂蜜、菜籽油和葱。将蘑菇和鸡肉放入混合物中,搅拌均匀。盖上盖子,在冰箱里腌制至少1小时。
预热烤架以获得高热量。
从腌料中取出蘑菇和鸡肉,并抖掉多余的部分。将腌料倒入一个小平底锅中,用大火煮沸。降温
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="recipe.xsl"?>
<recipesXML xmlns="http://www.w3schools.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3schools.com recipe.xsd ">
    <recipe>
        <name> Burnt Cookies </name>
        <image>images/burntcookie.jpg</image>
        <prepTime> 120 min </prepTime>
        <cookTime> 300 min </cookTime>
        <ingredients>Animal Crackers</ingredients>
        <instructions>
            <step num="1">Place Animal Crackers on a pan</step>
            <step num="2">Place Pan in Oven</step>
            <step num="3"> ... </step>
            <step num="4">Profit</step>
        </instructions>
    </recipe>
    <recipe>
        <name>Delicious Black Bean Burritos</name>
        <image>images/</image>
        <prepTime>10 min</prepTime>
        <cookTime>15 min</cookTime>
        <ingredients>2 (10 inch) flour tortillas</ingredients>
        <ingredients>2 tablespoons vegetable oil</ingredients>
        <ingredients>1 small onion, chopped</ingredients>
        <ingredients>1/2 red bell pepper, chopped</ingredients>
        <ingredients>1 teaspoon minced garlic</ingredients>
        <ingredients>1 (15 ounce) can black beans, rinsed and drained</ingredients>
        <ingredients>1 teaspoon minced jalapeno peppers</ingredients>
        <ingredients>3 ounces cream cheese</ingredients>
        <ingredients>1/2 teaspoon salt</ingredients>
        <ingredients>2 tablespoons chopped fresh cilantro</ingredients>
        <instructions>
            <step num="1">Wrap tortillas in foil and place in oven heated to 350 degrees F (175 degrees C). Bake for 15 minutes or until heated through.</step>
            <step num="2">Heat oil in a 10-inch skillet over medium heat. Place onion, bell pepper, garlic and jalapenos in skillet, cook for 2 minutes stirring occasionally. Pour beans into skillet, cook 3 minutes stirring.</step>
            <step num="3">Cut cream cheese into cubes and add to skillet with salt. Cook for 2 minutes stirring occasionally. Stir cilantro into mixture.</step>
            <step num="4">Spoon mixture evenly down center of warmed tortilla and roll tortillas up. Serve immediately.</step>
        </instructions>
    </recipe>
    <recipe>
        <name>Cream of Asparagus Soup</name>
        <image>images/aspSoup.jpg</image>
        <prepTime>30 min</prepTime>
        <cookTime>30 min</cookTime>
        <ingredients>1/4 cup margarine</ingredients>
        <ingredients>1 onion, chopped</ingredients>
        <ingredients>3 stalks celery, chopped</ingredients>
        <ingredients>3 tablespoons all-purpose flour</ingredients>
        <ingredients>4 cups water</ingredients>
        <ingredients>1 (10.5 ounce) can condensed chicken broth</ingredients>
        <ingredients>4 tablespoons chicken bouillon powder</ingredients>
        <ingredients>1 potato, peeled and diced</ingredients>
        <ingredients>1 pound fresh asparagus, trimmed and coarsely chopped</ingredients>
        <ingredients>3/4 cup half-and-half</ingredients>
        <ingredients>1 tablespoon soy sauce</ingredients> 
        <ingredients>1/4 teaspoon ground black pepper</ingredients> 
        <ingredients>1/4 teaspoon ground white pepper</ingredients> 
        <instructions>
            <step num="1">Melt butter or margarine in a heavy cooking pot. Add onions and chopped celery; saute until tender, about 4 minutes. Stir in flour, mixing well. Cook for about 1 minute, stirring constantly. Do not burn, or let it go lumpy. Add water, chicken broth, and chicken soup base; stir until smooth. Bring to a boil. Add diced potatoes and chopped asparagus. Reduce heat, and simmer for about 20 minutes.</step>
            <step num="2">Puree soup in a food processor or blender in batches. Return to pot.</step>
            <step num="3">Stir in half and half cream, soy sauce, and black and white pepper. Bring soup just to boil. Adjust seasonings to taste. Serve hot.</step>
        </instructions>
    </recipe>
    <recipe>
        <name>Carrot Cake IV</name>
        <image>images/carrotcake.jpg</image>
        <prepTime>30 min</prepTime>
        <cookTime>30 min</cookTime>
        <ingredients>1 (18.5 ounce) package carrot cake mix</ingredients>
        <ingredients>1/2 cup water</ingredients>
        <ingredients>1/2 cup vegetable oil</ingredients>
        <ingredients>3 eggs</ingredients>
        <ingredients>1/2 cup finely chopped walnuts</ingredients>
        <ingredients>1 (8 ounce) can crushed pineapple with juice</ingredients>
        <instructions>
            <step num="1">Preheat oven to 350 degrees F (175 degrees C). Grease and flour two 8 inch round pans.</step>
            <step num="2">In large bowl, blend cake mix, oil, water, undrained pineapple, eggs, and nuts. Beat for 2 minutes with an electric mixer at medium speed. Spread batter into prepared pans.</step>
            <step num="3">Bake for 35 to 40 minutes, or until a toothpick inserted in the center comes out clean. Cool. Frost with cream cheese frosting.</step>
        </instructions>
    </recipe>
    <recipe>
        <name>Eggy Veggie Bake</name>
        <image>images/eggveggie.jpg</image>
        <prepTime>10 min</prepTime>
        <cookTime>35 min</cookTime>
        <ingredients>1 tablespoon olive oil</ingredients>
        <ingredients>1 cup sliced halved zucchini</ingredients>
        <ingredients>3 green onions, chopped</ingredients>
        <ingredients>1/2 sweet onion, thinly sliced</ingredients>
        <ingredients>2 roma (plum) tomatoes, chopped</ingredients>
        <ingredients>1/2 cup chopped fresh mushrooms</ingredients>
        <ingredients>3 cups chopped baby spinach</ingredients>
        <ingredients>1/2 lemon, juiced</ingredients>
        <ingredients>Worcestershire sauce to taste</ingredients>
        <ingredients>hot sauce to taste</ingredients>
        <ingredients>garlic powder to taste</ingredients> 
        <ingredients>salt and ground black pepper to taste</ingredients> 
        <ingredients>1 1/2 cups liquid egg substitute</ingredients> 
        <ingredients>1/4 cup shredded Cheddar cheese</ingredients>
        <instructions>
            <step num="1">Preheat oven to 350 degrees F (175 degrees C). Spray an 8x8 inch baking dish with cooking spray.</step>
            <step num="2">Heat the olive oil in a skillet over medium-high heat. Place zucchini, green onions, onion, tomatoes, mushrooms, and spinach in the skillet. Sprinkle with lemon juice, Worcestershire sauce, and hot sauce. Season with garlic powder, salt, and pepper. Cook until tender. Transfer to the prepared baking dish. Pour egg substitute over the vegetables in the dish. Top with cheese.</step>
            <step num="3">Bake 20 minutes in the preheated oven, or until egg substitute is set and cheese is melted. Cut with a spatula and enjoy!</step>
        </instructions>
    </recipe>
    <recipe>
        <name>Chicken and Bacon Shish Kabobs</name>
        <image>images/ChickenBaconShish.jpg</image>
        <prepTime>25 min</prepTime>
        <cookTime>20 min</cookTime>
        <ingredients>1/4 cup soy sauce</ingredients>
        <ingredients>1/4 cup cider vinegar</ingredients>
        <ingredients>2 tablespoons honey</ingredients>
        <ingredients>2 tablespoons canola oil</ingredients>
        <ingredients>10 large mushrooms, cut in half</ingredients>
        <ingredients>2 green onions, minced</ingredients>
        <ingredients>3 skinless, boneless chicken breast halves - cut into chunks</ingredients>
        <ingredients>1/2 pound sliced thick cut bacon, cut in half</ingredients>
        <ingredients>1 (8 ounce) can pineapple chunks, drained</ingredients>
        <ingredients>skewers</ingredients>
        <instructions>
            <step num="1">In a large bowl, mix the soy sauce, cider vinegar, honey, canola oil, and green onions. Place the mushrooms and chicken into the mixture, and stir to coat. Cover, and marinate in the refrigerator at least 1 hour.</step>
            <step num="2">Preheat grill for high heat.</step>
            <step num="3">Remove the mushrooms and chicken from the marinade and shake off excess. Pour the marinade into a small saucepan and bring to a boil over high heat. Reduce heat to medium-low and simmer for 10 minutes; set aside.</step>
            <step num="4">Wrap the chicken chunks with bacon, and thread onto skewers so that the bacon is secured. Alternate with mushroom halves and pineapple chunks.</step>
            <step num="5">Lightly oil the grill grate. Arrange skewers on the prepared grill. Cook 15 to 20 minutes, brushing occasionally with remaining soy sauce mixture, until bacon is crisp and chicken juices run clear.</step>
        </instructions>
    </recipe>
    <recipe>
        <name>Amish Bread</name>
        <image>images/amishbread.jpg</image>
        <prepTime>5 min</prepTime>
        <cookTime>180 min</cookTime>
        <ingredients>2 3/4 cups bread flour</ingredients>
        <ingredients>1/4 cup canola oil</ingredients>
        <ingredients>1 teaspoon active dry yeast</ingredients>
        <ingredients>1/4 cup white sugar</ingredients>
        <ingredients>1/2 teaspoon salt</ingredients>
        <ingredients>18 tablespoons warm water</ingredients>
        <instructions>
            <step num="1">Place ingredients in the pan of the bread machine in the order recommended by the manufacturer. Select White Bread cycle; press Start.</step>
            <step num="2">When the dough has raised once and second cycle of kneading begins, turn machine off. Reset by pressing Start once again. This gives the dough two full raising cycles before the final raising cycle prior to baking.</step>
        </instructions>
    </recipe>
    <recipe>
        <name>Pizza Crust Fantastico</name>
        <image>images/pizzaCrustFantastico.jpg</image>
        <prepTime>20 min</prepTime>
        <cookTime>15 min</cookTime>
        <ingredients>1 1/2 cups warm water (110 degrees F/45 degrees C)</ingredients>
        <ingredients>1 tablespoon honey</ingredients>
        <ingredients>1 3/4 teaspoons active dry yeast</ingredients>
        <ingredients>2 1/2 cups all-purpose flour</ingredients>
        <ingredients>3/4 cup whole wheat flour</ingredients>
        <ingredients>1/4 cup corn flour</ingredients>
        <ingredients>1 teaspoon salt</ingredients>
        <ingredients>1 teaspoon ground black pepper</ingredients>
        <ingredients>1 teaspoon dried oregano</ingredients>
        <ingredients>1 teaspoon dried basil leaves</ingredients>
        <ingredients>1 teaspoon dried rosemary, chopped</ingredients> 
        <ingredients>1/2 cup tomato sauce</ingredients> 
        <ingredients>2 tablespoons olive oil</ingredients>
        <instructions>
            <step num="1">Pour warm water into a small bowl. Dissolve honey and yeast in water. Let stand until creamy, about 10 minutes.</step>
            <step num="2">In a large bowl, combine the all-purpose flour, whole wheat flour, corn flour, salt, black pepper, oregano, basil and rosemary. Add the yeast mixture, tomato sauce and olive oil; stir well to combine.</step>
            <step num="3">When the dough has pulled together, turn it out onto a lightly floured surface and knead until smooth and elastic, about 8 minutes. Lightly oil a large bowl, place the dough in the bowl and turn to coat with oil. Cover with a damp cloth and let rise in a warm place until doubled in volume, about 1 hour. Meanwhile, preheat oven to 450 degrees F (230 degrees C) place pizza stone in oven if one is to be used.</step>
            <step num="4">Deflate the dough and turn it out onto a lightly floured surface. Divide the dough into two equal pieces and form into rounds, cover and let rest for 10 minutes.</step>
            <step num="5">Roll the rounds out to crust size. Spread crusts with desired pizza sauce from the center outward and cover with desired toppings. Bake on preheated pizza stone or on lightly oiled pizza pans until cheese is bubbly and golden, about 12 minutes</step>
        </instructions>
    </recipe>
</recipesXML>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
        <html>
            Testing HTML
            <body>
                Testing Body
                <table border="1">
                 Testing Table
                    <xsl:for-each select="//recipe">
                        Testing Each Recipe
                        <tr>
                            <td>
                                Test
                                <xsl:element name="img">
                                    <xsl:attribute name="src"><xsl:value-of select="image"/></xsl:attribute>
                                    <xsl:attribute name="alt">recipe</xsl:attribute>
                                </xsl:element>
                            </td>
                            <td>
                                <xsl:value-of select="name"></xsl:value-of>
                            </td>
                        </tr>
                    </xsl:for-each>
                </table>
            </body>
        </html>
    </xsl:template>
</xsl:stylesheet>
<img src="{image}" alt="recipe"/>