L
Li Ming
Now I'm learning how to write xsl to transform an xml document. I am trapped
by a problem, and here's the sample xml document:
<category>
<cd type="pop">Pop music</cd>
<cd type="rock">Rock</cd>
<cd type="classical">Classical music</cd>
</category>
<cdshelf>
<disc name="CCC" cg="pop"/>
<disc name="BBB" cg="pop"/>
<disc name="AAA" cg="pop"/>
<disc name="DDD" cg="classical"/>
<disc name="EEE" cg="rock"/>
<disc name="FFF" cg="classcial"/>
<disc name="GGG" cg="pop"/>
</cdshelf>
I want the target html page like this:
Pop music:
1. CCC
2. BBB
3. AAA
4. GGG
Rock:
1. EEE
Classical music:
1. DDD
2. FFF
Can I achieve it using xslt? Thank you.
by a problem, and here's the sample xml document:
<category>
<cd type="pop">Pop music</cd>
<cd type="rock">Rock</cd>
<cd type="classical">Classical music</cd>
</category>
<cdshelf>
<disc name="CCC" cg="pop"/>
<disc name="BBB" cg="pop"/>
<disc name="AAA" cg="pop"/>
<disc name="DDD" cg="classical"/>
<disc name="EEE" cg="rock"/>
<disc name="FFF" cg="classcial"/>
<disc name="GGG" cg="pop"/>
</cdshelf>
I want the target html page like this:
Pop music:
1. CCC
2. BBB
3. AAA
4. GGG
Rock:
1. EEE
Classical music:
1. DDD
2. FFF
Can I achieve it using xslt? Thank you.