2 - XML and XSLT

Each bullet point represents a lab you will do whilst going through the XML chapter
  1. You will have covered the basics of XML, what's an element, CDATA, attributes etc.  Using this knowledge represent the following image as an XML document
  2. You should have covered and discussed the differences between elements and attributes.  This exercise is about lateral thinking.  How would you represent the following information as an XML document?  Use the following example as a guide!
  3. XSLT is a powerful tool for transforming an XML document to another document type.  With it, anything can be outputted to the output stream or any thing within the input stream can be consumed.  Given our limited time we are going demonstrate how this tool works.  These exercises should be enough to allow you to understand the much larger example that the lecturer will demonstrate to you.  In the labs software folder you will find the file xml-samples.zip (create a subfolder of c:\work called xml - extract xml-samples.zip to that folder), it contains the files you will need for the following labs
    1. Using the XML editor of your choice (it must support XML transformation using XSLT), open samples/HelloWorld.xml and Interface translator/basic-xsl-01.xsl.  Follow the instructions in the comments.
      1. you should have noticed when you transform the document that all the CDATA was copied directly to the output stream.  This is the default behaviour of the following template
      2. also, the following template, allows recursive processing to continue in the absence of a successful pattern match by an explicit template rule in the stylesheet. This template rule applies to both element nodes and the root node
    2. Now open basic-xsl-02.xsl and transform HelloWorld.xml with it.  Follow the instructions in the comments
      1. notice what happens with the text ENTRYEXIT[ and ] - they are written directly to the output stream
      2. what happens when you comment out the statement <xsl:value-of select="."/> within the template match="text()|@*" ?
    3. Now open basic-xsl-03.xsl and transform HelloWorld.xml with it.  Follow the instructions in the comments
    4. Now open basic-xsl-04.xsl and transform HelloWorld.xml with it.  Follow the instructions in the comments


It is important that you follow each step carefully to fully understand the benefits of XSLT and XML working together