xml ファイルの要素を番号付きリストとして表示するための xsl を作成します。しかし、私のIEエクスプローラーは毎回リストを表示しません。私のコードの何が問題なのか知りたいです。
これが私のxslファイルです:
<?xml version = "1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/xsl/Transform">
<xsl:template match="/">
<html>
<body>
<ul>
<xsl:for-each select="Recipe/Ingredients/Ingredient">
<li><xsl:value-of select="name"/></li>
</xsl:for-each>
</ul>
<ol>
<xsl:for-each select="Recipe/Steps/Step">
<li><xsl:value-of select="Action"/></li>
</xsl:for-each>
</ol>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
これが私のxmlファイルです:
<?xml version = "1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="recipe.xsl"?>
<!DOCTYPE Recipe [
<!ELEMENT Recipe (Ingredients, Steps, Nutrition)>
<!ATTLIST Recipe Recipe_name NMTOKEN #REQUIRED>
<!ATTLIST Recipe Recipe_Lan (EN|FI|JP|CH) "EN">
<!ELEMENT Ingredients (Ingredient+)>
<!ELEMENT Ingredient (name,Composedby?)>
<!ELEMENT name (#PCDATA)>
<!-- PCDATA means the parsed character data, while CDATA refers to unparsed character data. so in an xml document, characters like"&",">" are illegal -->
<!ELEMENT Composedby (Ingredient+)>
<!ATTLIST Ingredient Uni_ID ID #REQUIRED>
<!ATTLIST Ingredient Amount CDATA #IMPLIED>
<!ELEMENT Steps (Step+)>
<!ELEMENT Step (Name, Action)>
<!ELEMENT Name (#PCDATA)>
<!ELEMENT Action (#PCDATA)>
<!ATTLIST Step Duration CDATA #REQUIRED>
<!ELEMENT Nutrition (Calories, Fat, Protain_amount)>
<!ELEMENT Calories (#PCDATA)>
<!ELEMENT Fat (#PCDATA)>
<!ELEMENT Protain_amount (#PCDATA)>
]>
<Recipe Recipe_name="Vinegar_pepper_Soup" Recipe_Lan="EN">
<Ingredients>
<Ingredient Uni_ID="V1" Amount="500ml">
<name>chicken broth</name>
<Composedby>
<Ingredient Uni_ID="V2" Amount="100g">
<name>chicken</name>
</Ingredient>
<Ingredient Uni_ID="V3" Amount="500g">
<name>water</name>
</Ingredient>
</Composedby>
</Ingredient>
<Ingredient Uni_ID="V4" Amount="50g">
<name>tofu</name>
</Ingredient>
<Ingredient Uni_ID="V5" Amount="10ml">
<name>vinegar</name>
</Ingredient>
<Ingredient Uni_ID="V6" Amount="10g">
<name>flour</name>
</Ingredient>
<Ingredient Uni_ID="V7" Amount="100g">
<name>winter bamboo shoots</name>
</Ingredient>
<Ingredient Uni_ID="V8" Amount="30g">
<name>carrot</name>
</Ingredient>
<Ingredient Uni_ID="V9" Amount="one">
<name>egg</name>
</Ingredient>
<Ingredient Uni_ID="V10" Amount="15ml">
<name>soya light</name>
</Ingredient>
<Ingredient Uni_ID="V11" Amount="5g">
<name>white pepper powder</name>
</Ingredient>
<Ingredient Uni_ID="V12" Amount="10ml">
<name>oil</name>
</Ingredient>
</Ingredients>
<Steps>
<Step Duration="3 minutes">
<Name>Washing</Name>
<Action>Wash all the stuffs</Action>
</Step>
<Step Duration="10 minutes">
<Name>Cutting</Name>
<Action>Cutting carrots, winter bamboo shoots and toufu into small pieces</Action>
</Step>
<Step Duration="3 minutes">
<Name>Egg Beating</Name>
<Action>Beat the egg</Action>
</Step>
<Step Duration="5 minutes">
<Name>Stuffs frying</Name>
<Action>Pour 10ml oil to the heated pot, wait until it gets warm, fry the cutting stuffs</Action>
</Step>
<Step Duration="3 minutes">
<Name>Water flour</Name>
<Action>Water the flour, pour it into the pot and stir</Action>
</Step>
<Step Duration="1 minutes">
<Name>Egg liquid Pouring</Name>
<Action>Pour the egg liquid to the pot and stir</Action>
</Step>
<Step Duration="1 minutes">
<Name>Seasoning</Name>
<Action>put the venigar, white pepper powder and soya light into the pot</Action>
</Step>
</Steps>
<Nutrition>
<Calories>50 cal per 100g</Calories>
<Fat>5g per 100g</Fat>
<Protain_amount>10g per 100g</Protain_amount>
</Nutrition>
</Recipe>
IE エクスプローラーは次のように表示されます。