hi,
need help on an xml task, im new to xml. the task is to build a xml catalogue which has 4 genres of music with two examples know i have manged to make that but im having difficulty write the code for the xsl stylesheet
hi,
need help on an xml task, im new to xml. the task is to build a xml catalogue which has 4 genres of music with two examples know i have manged to make that but im having difficulty write the code for the xsl stylesheet
I'm not going to do your homework but I can recommend a very good tutorial resource: http://www.zvon.org/xxl/XSLTutorial/Books/Book1/index.html which gives many examples of simple XSLT in action.
You could iterate (xsl:for-each) over all the rock
children and then select each child in sequence and create whatever output XML you want (you will need to design this anyway)
W3Schools has some good resources as well. http://www.w3schools.com/xsl/default.asp http://www.w3schools.com/xpath/default.asp
Here is a spec on XML Catalogs: http://www.oasis-open.org/committees/entity/spec-2001-08-06.html
One thing to keep in mind while writing XSL is that you are dealing with sets. Anytime you use a select attribute it returns a set of nodes, even if it is a set of 1.
Look into xsl:element and xsl:attribute for creating new elements and attributes.