Z
Zhou Lei
Hello I'm posting a new article about the category. The following XML
segment was posted by Li some days ago and I'm trying to do some more work:
<shop name="myshop">
<category>
<cd type="pop">Pop music</cd>
<cd type="rock">Rock</cd>
<cd type="classical">Classical music</cd>
</category>
<welcome>Welcome to myshop</welcome>
<content>
<headline>Music CD</headline>
<location name="Address">
<cdshelf>
<disc name="CCC" cg="pop"/>
<disc name="AAA" cg="pop"/>
<disc name="EEE" cg="rock"/>
<disc name="GGG" cg="pop"/>
</cdshelf>
</location>
<location name="AnotherAddress">
<cdshelf>
<disc name="BBB" cg="classical"/>
<disc name="DDD" cg="pop"/>
<disc name="FFF" cg="classical"/>
</cdshelf>
</location>
</content>
</shop>
The desired web output:
Welcome to myshop
Music CD
Location Address:
Pop music:
1. CCC
3. AAA
4. GGG
Rock:
1. EEE
Location AnotherAddress:
Classical music:
1. BBB
2. FFF
Pop music:
1. DDD
The XML file contains 2 locations, and each location has different kinds of CDs
available (some are unavailable, for example, classical CDs are absent at
location "Address"). And the correct CDs should appear according to
its location and the category should be listed in ascendent order. Is it
possible to do it? Thank you.
segment was posted by Li some days ago and I'm trying to do some more work:
<shop name="myshop">
<category>
<cd type="pop">Pop music</cd>
<cd type="rock">Rock</cd>
<cd type="classical">Classical music</cd>
</category>
<welcome>Welcome to myshop</welcome>
<content>
<headline>Music CD</headline>
<location name="Address">
<cdshelf>
<disc name="CCC" cg="pop"/>
<disc name="AAA" cg="pop"/>
<disc name="EEE" cg="rock"/>
<disc name="GGG" cg="pop"/>
</cdshelf>
</location>
<location name="AnotherAddress">
<cdshelf>
<disc name="BBB" cg="classical"/>
<disc name="DDD" cg="pop"/>
<disc name="FFF" cg="classical"/>
</cdshelf>
</location>
</content>
</shop>
The desired web output:
Welcome to myshop
Music CD
Location Address:
Pop music:
1. CCC
3. AAA
4. GGG
Rock:
1. EEE
Location AnotherAddress:
Classical music:
1. BBB
2. FFF
Pop music:
1. DDD
The XML file contains 2 locations, and each location has different kinds of CDs
available (some are unavailable, for example, classical CDs are absent at
location "Address"). And the correct CDs should appear according to
its location and the category should be listed in ascendent order. Is it
possible to do it? Thank you.