Html 如何将css应用于特定的xml/xsl元素?

Html 如何将css应用于特定的xml/xsl元素?,html,css,xml,xslt,Html,Css,Xml,Xslt,我想在我的配料上应用一些css修改(创建一个列表),我不知道如何调用每个配料及其子元素(数量、过程) 这里是我的html: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="recipes.xsl"?> <recipes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNa

我想在我的配料上应用一些css修改(创建一个列表),我不知道如何调用每个配料及其子元素(数量、过程)

这里是我的html:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="recipes.xsl"?>

<recipes
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="recipe.xsd">
    <recipe id= "1">
        <name>Gooseberry crème brulée tart</name>
        <author>Barney Desmazery</author>
        <Magazine_subscription>5 issues for £5</Magazine_subscription>
        <preparation_time>Preparation Time: 10 mins</preparation_time>
        <cooking_time>Cooking Time: 80 mins</cooking_time>
            <additional_time></additional_time>
        <serves>Serves: 8</serves>
        <level>Difficulty: Moderately easy</level>
        <overview>Overview: Seasonal berries and sweet pastry make a stunning dessert for a dinner party - blowtorch for a beautifully crisp cracked sugar topping</overview>
        <nutrition>
            <kcalories>467</kcalories>
            <fat>21g</fat>
                <saturates>11g</saturates>
            <carbs>60g</carbs>
                <sugars>39g</sugars>
            <fibre>3g</fibre>
            <protein>7g</protein>
            <salt>0.4g</salt>
        </nutrition>    
            <ingredients>
                <ingredient>Gooseberries</ingredient>
                    <quantity>450g</quantity>
                    <process/>
                <ingredient>White caster sugar</ingredient>
                    <quantity>200g</quantity>
                    <process/>
                <ingredient>Eggs</ingredient>
                    <quantity>4</quantity>
                    <process/>
                <ingredient>Double cream</ingredient>
                    <quantity>100ml</quantity>
                    <process/>
                <ingredient>Block sweet pastry</ingredient>
                    <quantity>500g</quantity>
                    <process/>
                <ingredient>Flour</ingredient>
                    <quantity>for dusting</quantity>
                    <process/>
            </ingredients>
            <method>
                <step>Tip the gooseberries into a saucepan with 100g of the sugar and 100ml water. Simmer for 8-10 mins until the fruit is soft and the juices are syrupy. Tip the fruit into a sieve set over a jug and leave to strain – you will need about 150ml of the syrupy juices. Tip the pulp into a bowl and leave to cool.</step>
                <step>In a separate bowl, beat the eggs with 50g of the sugar, then beat in the cream and gooseberry syrup. Strain through a sieve into another jug and set aside.</step>
                <step>Heat oven to 160C/140C fan/gas 3. Roll out the pastry on a lightly floured surface to the thickness of a £1 coin, then lift into a 23cm tart tin. Press down gently on the bottom and sides, leaving a slight overhang. Line the tart with foil and fill with baking beans. Bake for 10 mins, then discard the foil and beans, and bake for another 20 mins. Remove from the oven and leave to cool.</step>
                <step>Reduce oven to 150C/130C fan/gas 2. Spread the pulp evenly over the base of the tart, then carefully pour the cream mixture over it to create 2 layers. Bake for 35-40 mins until the cream layer has the slightest wobble to it</step>   
            </method>       
    </recipe>
    <recipe id= "2">
        <name>Roast sirloin of beef</name>
        <author>Gary Rhodes</author>
        <Magazine_subscription>5 issues for £5</Magazine_subscription>
        <preparation_time>Preparation Time: 10 mins</preparation_time>
        <cooking_time>Cooking Time: 150 mins</cooking_time>
            <additional_time>Resting time</additional_time>
        <serves>Serves: 6</serves>
        <level>Difficulty: Easy</level>
        <overview>Overview: Gary Rhodes' delicious, succulent roast beef dish is perfect for Boxing Day lunch or an alternative Christmas Day roast. Just four ingredients</overview>
        <nutrition>
            <kcalories>331</kcalories>
            <fat>19g</fat>
                <saturates>8g</saturates>
            <carbs>1g</carbs>
                <sugars>0g</sugars>
            <fibre>0g</fibre>
            <protein>36g</protein>
            <salt>1.47g</salt>
        </nutrition>    
            <ingredients>
                <ingredient>Vegetable oil or beef fat</ingredient>
                    <quantity>2tbsp</quantity>
                    <process/>
                <ingredient>Sirlon of beef joint</ingredient>
                    <quantity>1-1 1/2kg/2lb 4-3lb 5oz</quantity>
                    <process/>
                <ingredient>Red wine</ingredient>
                    <quantity>1 glass</quantity>
                    <process/>
                <ingredient>Can beef consommé</ingredient>
                    <quantity>400g</quantity>
                    <process/>                  
            </ingredients>
            <method>
                <step>Heat oven to 200C/fan 180C/gas 6. Heat the oil or fat in a large fl ameproof roasting tin in the oven for 5-10 mins. Season the beef all over.</step>
                <step>Place the joint fat-side down in the roasting tin and put it on the hob. Sizzle to release some of the fat, then turn the beef in the fat to seal and colour it all over, about 5 mins. The joint can now be roasted, fat-side up, allowing 10-15 mins per 450g for medium-rare, 15-20 mins per 450g for medium, 20-25 mins for medium-well and 25-30 mins for well done. Turn the joint halfway through its cooking time for an even roast. Once roasted, remove the beef from the pan and leave to one side, loosely covered with foil, to rest for 15-20 mins</step>
                <step>Meanwhile, pour off any excess fat from the roasting tin, then put the tin on a medium heat on top of the stove. Once it begins to sizzle, pour in the red wine, allowing it to boil rapidly until almost completely evaporated. Tip in the consommé and allow to simmer for 4-5 mins. This will give a light sauce, rather than a gravy (see tip, below). Simmer for a few more mins before straining through a sieve for the smoothest of fi nishes. Carve the beef into thick slices, offering the gravy separately.</step>    
            </method>           
    </recipe>
    <recipe id= "3">
        <name>Haddock &amp; leek au gratin with sweetcorn mash</name>
        <author>Sara Buenfeld</author>
        <Magazine_subscription>5 issues for £5</Magazine_subscription>
        <preparation_time>Preparation Time: 10 mins</preparation_time>
        <cooking_time>Cooking Time: 50 mins</cooking_time>
            <additional_time></additional_time>
        <serves>Serves: 2</serves>
        <level>Difficulty: Easy</level>
        <overview>Overview: Leek and spinach are layered up with white fish fillets and cheese sauce then topped with golden mash in this delicious, low-fat oven bake.</overview>
        <nutrition>
            <kcalories>618</kcalories>
            <fat>13g</fat>
                <saturates>6g</saturates>
            <carbs>70g</carbs>
                <sugars>20g</sugars>
            <fibre>11g</fibre>
            <protein>50g</protein>
            <salt>2.1g</salt>
        </nutrition>    
            <ingredients>
                <ingredient>Potatoes</ingredient>
                    <quantity>350g</quantity>
                    <process>quartered</process>
                <ingredient>Can sweetcorn in water</ingredient>
                    <quantity>195g</quantity>
                    <process/>
                <ingredient>Bag ready-washed spinach</ingredient>
                    <quantity>240g</quantity>
                    <process/>
                <ingredient>Leaks</ingredient>
                    <quantity>2</quantity>
                    <process>Thickly sliced</process>
                <ingredient>Skimmed milk</ingredient>
                    <quantity>plus 3 tbsp</quantity>
                    <process/>
                <ingredient>Unsalted butter</ingredient>
                    <quantity>15g</quantity>
                    <process/>
                <ingredient>Plain flour</ingredient>
                    <quantity>15g</quantity>
                    <process/>
                <ingredient>English mustard</ingredient>
                    <quantity>1/2 tsp</quantity>
                    <process/>
                <ingredient>Mature reduced-fat cheese</ingredient>
                    <quantity>75g</quantity>
                    <process>grated</process>
                <ingredient>Fillets of skinless haddock</ingredient>
                    <quantity>2 x 125g</quantity>
                    <process/>                                          
            </ingredients>
            <method>
                <step>Heat oven to 200C/180 fan/gas 6. Boil the potatoes for 15-20 mins until tender, then drain. Reserve 3 tbsp corn and blitz the rest (with its juice) using a hand blender or a food processor until completely smooth, then mash into the potatoes. Cook the spinach following pack instructions – if you have a microwave, choose this method.</step>
                <step>Put the leeks in a pan with the 300ml milk and the butter. Cook gently, part-covered, for 8 mins until the leeks are tender. (Keep an eye on things as milk can easily boil over.) Mix the 3 tbsp milk with the flour and mustard, then stir into the leek mixture – keep stirring until thickened. Take off the heat and stir in three-quarters of the cheese.</step>
                <step>Squeeze as much liquid as you can from the spinach, then arrange on the base of 2 gratin dishes. Place a fish fillet on top of each, then spoon over the leek &amp; cheese sauce. Top with the sweetcorn mash. Mix the remaining corn and cheese, and scatter on top. Place the dishes on a baking tray and cook for 25 mins until the fish flakes when tested and the top is golden.</step>  
            </method>           
    </recipe>
    <recipe id= "4">
        <name>Cheesy mushroom omelette</name>
        <author>Good Food</author>
        <Magazine_subscription>5 issues for £5</Magazine_subscription>
        <preparation_time>Preparation Time: 5 mins</preparation_time>
        <cooking_time>Cooking Time: 10 mins</cooking_time>
            <additional_time></additional_time>
        <serves>1</serves>
        <level>Difficulty: Easy</level>
        <overview>Overview: Whip up a tasty omelette with this recipe</overview>
        <nutrition>
            <kcalories>391</kcalories>
            <fat>33g</fat>
                <saturates>10g</saturates>
            <carbs>0.3g</carbs>
                <sugars>0.2g</sugars>
            <fibre>0.7g</fibre>
            <protein>22g</protein>
            <salt>0.9g</salt>
        </nutrition>    
            <ingredients>
                <ingredient>Olive oil</ingredient>
                    <quantity>1tbsp</quantity>
                    <process/>
                <ingredient>Handful button or chestnut mushrooms</ingredient>
                    <quantity/>
                    <process></process>
                <ingredient>Vegetarian cheddar,grated</ingredient>
                    <quantity>25g</quantity>
                    <process/>
                <ingredient>Small handfull parsley leaves</ingredient>
                    <quantity></quantity>
                    <process>Roughly chopped</process>
                <ingredient>Eggs</ingredient>
                    <quantity>2</quantity>
                    <process>beaten</process>                                       
            </ingredients>
            <method>
                <step>Heat the olive oil in a small non-stick frying pan. Tip in the mushrooms and fry over a high heat, stirring occasionally for 2-3 mins until golden. Lift out of the pan into a bowl and mix with the cheese and parsley.</step>
                <step>Place the pan back on the heat and swirl the eggs into it. Cook for 1 min or until set to your liking, swirling with a fork now and again.</step>
                <step>Spoon the mushroom mix over one half of the omelette. Using a spatula or palette knife, flip the omelette over to cover the mushrooms. Cook for a few moments more, lift onto a plate and serve with oven chips and salad.</step> 
            </method>           
    </recipe>                                                                               
</recipes>

醋栗奶油馅饼
巴尼·德斯马泽里
5期5英镑
准备时间:10分钟
烹饪时间:80分钟
发球:8
难度:中等难度
概述:时令浆果和甜点是晚餐派对上的绝妙甜点——喷灯是一种精美的脆裂糖配料
467
21g
11g
60克
39g
3g
7g
0.4g
醋栗
450克
白砂糖
200克
鸡蛋
4.
双层奶油
100毫升
块状甜点
500克
面粉
用于除尘
将醋栗倒入平底锅中,加入100克糖和100毫升水。炖8-10分钟,直到水果变软,果汁变成糖浆状。把水果倒进一个放在罐子上的筛子里,然后过滤——你们需要大约150毫升的糖浆汁。将果肉倒进碗中冷却。
在另一个碗里,用50克糖打鸡蛋,然后加入奶油和醋栗糖浆。用筛子滤入另一个罐子,放在一边。
将烤箱加热至160C/140C风机/煤气3。将面团在撒了少量面粉的表面上擀成一枚1英镑硬币的厚度,然后放入一个23厘米厚的蛋挞罐中。轻轻向下按压底部和侧面,留下轻微悬垂。在蛋挞上衬上箔纸,然后装满烤豆。烤10分钟,然后扔掉箔纸和豆子,再烤20分钟。从烤箱中取出,待其冷却。
将烤箱温度降至150C/130C风机/煤气2。将果肉均匀地铺在蛋挞的底部,然后小心地将奶油混合物倒在上面,形成两层。烘烤35-40分钟,直到奶油层有轻微的晃动
烤牛腰肉
加里·罗德斯
5期5英镑
准备时间:10分钟
烹饪时间:150分钟
休息时间
发球:6
难度:容易
概述:Gary Rhodes美味多汁的烤牛肉是节礼日午餐或圣诞节替代烤牛肉的完美选择。只有四种成分
331
19g
8g
1g
0g
0g
36克
1.47克
植物油还是牛肉油
2汤匙
牛肉接头锡隆
1-1 1/2千克/2磅4-3磅5盎司
红葡萄酒
1杯
牛肉清汤可以吗
400克
将烤箱加热至200C/风扇180C/气体6。将油或脂肪放入一个大的耐热烤箱中加热5-10分钟。把牛肉调味。
把关节脂肪的一面放在烤箱里,放在滚刀上。嘶嘶作响释放一些脂肪,然后将牛肉放入脂肪中密封并涂上颜色,大约5分钟。现在可以烘烤接头,脂肪面朝上,允许每450g中熟10-15分钟,每450g中熟15-20分钟,中熟20-25分钟,熟透25-30分钟。在烹调时间的一半转动接头,使烤肉均匀。烤好后,将牛肉从锅中取出,放在一边,用箔纸松松地覆盖,静置15-20分钟
同时,倒掉烤箱里多余的脂肪,然后把烤箱放在炉子上的中火上。一旦开始嘶嘶作响,倒入红酒,让它迅速沸腾,直到几乎完全蒸发。倒入清汤,慢炖4-5分钟。这将提供一种清淡的酱汁,而不是肉汁(见下面的提示)。再炖几分钟,然后用筛子过滤,以获得最光滑的表面。将牛肉切成厚片,分别提供肉汁。
黑线鳕;烤韭菜配甜玉米泥
萨拉·布恩菲尔德
5期5英镑
准备时间:10分钟
烹饪时间:50分钟
发球:2
难度:容易
概述:韭菜和菠菜用白色鱼片和奶酪酱分层,然后在这道美味低脂的烤箱里撒上金色的土豆泥。
618
13g
6g
70克
20克
11g
50克
2.1g
土豆
350克
四分之一
甜玉米能放在水里吗
195g
袋装洗好的菠菜
240克
泄漏
2.
厚切片
脱脂牛奶
加3汤匙
無鹽奶油
15克
中筋面粉
15克
英国芥末
1/2茶匙
成熟低脂奶酪
75克
磨碎
去皮黑线鳕鱼片
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="recipes/recipe">
    <html>
        <head>
            <title>Recipes</title>
            <meta charset="utf-8" />
            <link rel="stylesheet" href="recipes.css" />
        </head>
        <body>
            <h1><xsl:value-of select="name"/></h1>
                <tr>
                    <xsl:value-of select="preparation_time"/><br/>
                    <br/>
                    <xsl:value-of select="cooking_time"/><br/>
                    <br/>
                    <xsl:value-of select="serves"/><br/>
                    <br/>
                    <xsl:value-of select="level"/><br/>
                    <br/>
                    <xsl:value-of select="overview"/><br/>
                    <br/>
                    <td><xsl:value-of select="ingredients"/></td>
                 </tr>                   
        </body>
    </html>
</xsl:template>    
</xsl:stylesheet>
 <xsl:for-each select="ingredients/ingredient">
<xsl:value-of select="." />
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" doctype-public="XSLT-compat" omit-xml-declaration="yes" encoding="UTF-8" indent="yes" />
<xsl:template match="recipes/recipe">
    <html>
        <head>
            <title>Recipes</title>
            <meta charset="utf-8" />
            <link rel="stylesheet" href="recipes.css" />
        </head>
        <body>
        <h1><xsl:value-of select="name"/></h1>
        <table>
            <tr>
                <td>
                    <xsl:value-of select="preparation_time"/><br/>
                    <br/>
                    <xsl:value-of select="cooking_time"/><br/>
                    <br/>
                    <xsl:value-of select="serves"/><br/>
                    <br/>
                    <xsl:value-of select="level"/><br/>
                    <br/>
                    <xsl:value-of select="overview"/><br/>
                    <h2>Ingredients</h2>
                    <ul>
                        <xsl:for-each select="ingredients/ingredient">
                            <li><xsl:value-of select="." /></li>
                        </xsl:for-each>
                    </ul>
                </td>
            </tr>
        </table>
        </body>
    </html>
</xsl:template>    
</xsl:stylesheet>
 <li>
     <xsl:value-of select="." /> 
     <xsl:text> (</xsl:text>
     <xsl:value-of select="following-sibling::quantity[1]" />
     <xsl:text>)</xsl:text>
 </li>