XML Page 2 Documentation
(This file is called "XMLPage2documentation.html".)

XSLT stylesheet document
<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" indent="yes"/> <xsl:template match="customers"> <HTML> <CENTER> <H1>Customer List</H1> <TABLE border="1" cellspacing="1" cellpadding="5"> <TH>Cust No</TH> <TH>Name</TH> <TH>Address</TH> <TH>Contacts</TH> <xsl:apply-templates select="customer"/> </TABLE> </CENTER> </HTML> </xsl:template> <xsl:template match="customer"> <TR> <TD><xsl:apply-templates select="@cno"/></TD> <TD><xsl:apply-templates select="name"/></TD> <TD><xsl:apply-templates select="address"/></TD> <TD><xsl:apply-templates select="contacts"/></TD> </TR> </xsl:template> <xsl:template match="address"> <xsl:value-of select="street"/> <BR/> <xsl:value-of select="suburb"/> <BR/> <xsl:value-of select="state"/> <xsl:text> </xsl:text> <xsl:value-of select="postcode"/> </xsl:template> <xsl:template match="contacts/*"> <B> <xsl:value-of select="name(.)"/> </B> <xsl:text> : </xsl:text> <xsl:value-of select="."/> <BR/> </xsl:template> </xsl:stylesheet>

The XML document
<?xml version="1.0"?> <?xml-stylesheet href="number2.xsl" type="text/xsl"?> <customers xsi:noNamespaceSchemaLocation="customers.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <customer cno="C111" corporate="false"> <name> <givenName>James</givenName> <familyName>Hird</familyName> </name> <address> <street>12 Raleigh Rd</street> <suburb>North Melbourne</suburb> <state>VIC</state> <postcode>3611</postcode> </address> <contacts> <home>(03) 9903-3401</home> <office>(03) 9903-3401</office> <mobile primary="true">04111222333</mobile> </contacts> </customer> <customer cno="C222" corporate="true"> <name> <companyName>Essendon Football Club</companyName> </name> <address> <street>10 Bomber Ave</street> <suburb>Windy Hill</suburb> <state>VIC</state> <postcode>3666</postcode> </address> <contacts> <name>Ray Horsburgh</name> <office primary="true">(03) 9111-9999</office> <mobile>04111222444</mobile> </contacts> <orders> <order no="O112"> <orderDate>2007-06-21</orderDate> <orderLine> <itemNo>I001</itemNo> <description>Orange Juice</description> <quantity>100</quantity> <unitPrice>1.50</unitPrice> <discount>2</discount> </orderLine> <orderLine> <itemNo>I002</itemNo> <description>Victoria Bitter</description> <quantity>200</quantity> <unitPrice>3</unitPrice> <discount>5</discount> </orderLine> </order> <order no="O121"> <orderDate>2006-01-20</orderDate> <orderLine> <itemNo>I001</itemNo> <description>Coke</description> <quantity>25</quantity> <unitPrice>1.20</unitPrice> <discount>0</discount> </orderLine> <orderLine> <itemNo>I002</itemNo> <description>Vegetarian Sandwich</description> <quantity>200</quantity> <unitPrice>2</unitPrice> <discount>5</discount> </orderLine> </order> <order no="O111"> <orderDate>2007-04-12</orderDate> <orderLine> <itemNo>I001</itemNo> <description>Sausage Roll</description> <quantity>100</quantity> <unitPrice>1</unitPrice> <discount>0</discount> </orderLine> <orderLine> <itemNo>I002</itemNo> <description>Meat Pies</description> <quantity>100</quantity> <unitPrice>2</unitPrice> <discount>10</discount> </orderLine> </order> </orders> </customer> <customer cno="C333" corporate="false"> <name> <givenName>Kevin</givenName> <familyName>Sheedy</familyName> </name> <address> <street>10 High St</street> <suburb>Essendon</suburb> <state>VIC</state> <postcode>3622</postcode> </address> <contacts> <home>(03) 9111-3333</home> <office>(03) 9111-9999</office> <mobile primary="true">04111222444</mobile> </contacts> <orders> <order no="O113"> <orderDate>2006-01-21</orderDate> <orderLine> <itemNo>I001</itemNo> <description>Sausage Roll</description> <quantity>1500</quantity> <unitPrice>1</unitPrice> <discount>20</discount> </orderLine> </order> <order no="O114"> <orderDate>2007-07-10</orderDate> <orderLine> <itemNo>I002</itemNo> <description>Meat Pies</description> <quantity>2000</quantity> <unitPrice>2</unitPrice> <discount>20</discount> </orderLine> <orderLine> <itemNo>I003</itemNo> <description>Orange Juice</description> <quantity>1000</quantity> <unitPrice>1.50</unitPrice> <discount>5</discount> </orderLine> </order> <order no="O122"> <orderDate>2007-01-01</orderDate> <orderLine> <itemNo>I001</itemNo> <description>Red Wine</description> <quantity>1500</quantity> <unitPrice>15</unitPrice> <discount>20</discount> </orderLine> </order> <order no="O115"> <orderDate>2007-07-11</orderDate> <orderLine> <itemNo>I001</itemNo> <description>Victoria Bitter</description> <quantity>2000</quantity> <unitPrice>3</unitPrice> <discount>10</discount> </orderLine> <orderLine> <itemNo>I002</itemNo> <description>Red Wine</description> <quantity>200</quantity> <unitPrice>15</unitPrice> <discount>2</discount> </orderLine> <orderLine> <itemNo>I003</itemNo> <description>Tomato and Ham Sandwich</description> <quantity>500</quantity> <unitPrice>2</unitPrice> <discount>5</discount> </orderLine> <orderLine> <itemNo>I004</itemNo> <description>Vegetarian Sandwich</description> <quantity>200</quantity> <unitPrice>2</unitPrice> <discount>0</discount> </orderLine> <orderLine> <itemNo>I005</itemNo> <description>Salmon Sandwich</description> <quantity>500</quantity> <unitPrice>3</unitPrice> <discount>0</discount> </orderLine> <orderLine> <itemNo>I006</itemNo> <description>Springroll</description> <quantity>1000</quantity> <unitPrice>0.5</unitPrice> <discount>0</discount> </orderLine> <orderLine> <itemNo>I007</itemNo> <description>White Wine</description> <quantity>500</quantity> <unitPrice>12</unitPrice> <discount>5</discount> </orderLine> </order> </orders> </customer> <customer cno="C444" corporate="false"> <name> <givenName>John</givenName> <familyName>Worsfold</familyName> </name> <address> <street>23 Bayview Ave</street> <suburb>South Perth</suburb> <state>WA</state> <postcode>6200</postcode> </address> <contacts> <home>(06) 6222-3333</home> <office>(06) 6222-9999</office> <mobile primary="true">04111222555</mobile> </contacts> <orders> <order no="O116"> <orderDate>2007-12-12</orderDate> <orderLine> <itemNo>I001</itemNo> <description>Orange Juice</description> <quantity>30</quantity> <unitPrice>1.50</unitPrice> <discount>0</discount> </orderLine> <orderLine> <itemNo>I002</itemNo> <description>Red Wine</description> <quantity>5</quantity> <unitPrice>15</unitPrice> <discount>0</discount> </orderLine> <orderLine> <itemNo>I003</itemNo> <description>Tomato and Ham Sandwich</description> <quantity>30</quantity> <unitPrice>2</unitPrice> <discount>0</discount> </orderLine> </order> <order no="O117"> <orderDate>2007-06-16</orderDate> <orderLine> <itemNo>I001</itemNo> <description>Tomato and Ham Sandwich</description> <quantity>30</quantity> <unitPrice>2</unitPrice> <discount>0</discount> </orderLine> </order> <order no="O123"> <orderDate>2007-06-17</orderDate> <orderLine> <itemNo>I001</itemNo> <description>Tomato and Ham Sandwich</description> <quantity>30</quantity> <unitPrice>2</unitPrice> <discount>0</discount> </orderLine> </order> </orders> </customer> <customer cno="C555" corporate="false"> <name> <givenName>Ben</givenName> <familyName>Cousins</familyName> </name> <address> <street>23 Long Ave</street> <suburb>West Perth</suburb> <state>WA</state> <postcode>6500</postcode> </address> <contacts> <home>(06) 6222-4444</home> <office>(06) 6222-9999</office> <mobile primary="true">04111222666</mobile> </contacts> <orders> <order no="O120"> <orderDate>2007-05-05</orderDate> <orderLine> <itemNo>I001</itemNo> <description>Sausage Roll</description> <quantity>15</quantity> <unitPrice>1</unitPrice> <discount>0</discount> </orderLine> </order> </orders> </customer> <customer cno="C666" corporate="true"> <name> <companyName>West Coast Football Club</companyName> </name> <address> <street>1 Eagle Dr</street> <suburb>Subiaco</suburb> <state>WA</state> <postcode>6666</postcode> </address> <contacts> <name>Dalton Gooding</name> <office primary="true">(06) 6222-9999</office> <mobile>04111222555</mobile> </contacts> <orders> <order no="O118"> <orderDate>2007-04-12</orderDate> <orderLine> <itemNo>I001</itemNo> <description>Orange Juice</description> <quantity>1000</quantity> <unitPrice>1.50</unitPrice> <discount>5</discount> </orderLine> <orderLine> <itemNo>I002</itemNo> <description>Tomato and Ham Sandwich</description> <quantity>500</quantity> <unitPrice>2</unitPrice> <discount>5</discount> </orderLine> <orderLine> <itemNo>I003</itemNo> <description>Vegetarian Sandwich</description> <quantity>200</quantity> <unitPrice>2</unitPrice> <discount>0</discount> </orderLine> <orderLine> <itemNo>I004</itemNo> <description>Salmon Sandwich</description> <quantity>500</quantity> <unitPrice>3</unitPrice> <discount>0</discount> </orderLine> <orderLine> <itemNo>I005</itemNo> <description>Springroll</description> <quantity>1000</quantity> <unitPrice>0.5</unitPrice> <discount>0</discount> </orderLine> <orderLine> <itemNo>I006</itemNo> <description>Rice Paper Roll</description> <quantity>1000</quantity> <unitPrice>1.5</unitPrice> <discount>2</discount> </orderLine> <orderLine> <itemNo>I007</itemNo> <description>BBQ Chicken Wing</description> <quantity>1500</quantity> <unitPrice>0.75</unitPrice> <discount>2</discount> </orderLine> </order> <order no="O119"> <orderDate>2007-07-01</orderDate> <orderLine> <itemNo>I001</itemNo> <description>Coke</description> <quantity>500</quantity> <unitPrice>1.2</unitPrice> <discount>0</discount> </orderLine> <orderLine> <itemNo>I002</itemNo> <description>Lemonade</description> <quantity>500</quantity> <unitPrice>1.5</unitPrice> <discount>0</discount> </orderLine> </order> </orders> </customer> </customers>

The HTML document
<H1>Customer List</H1> <TABLE border="0" cellspacing="1" cellpadding="5"> <TH>Cust No</TH> <TH>Name</TH> <TH>Address</TH> <TH>Contacts</TH> <TR> <TD>C111</TD> <TD>JamesHird</TD> <TD>12 Raleigh Rd<BR> North Melbourne<BR> VIC 3611</TD> <TD><B>home</B> : (03) 9903-3401<BR> <B>office</B> : (03) 9903-3401<BR> <B>mobile</B> : 04111222333<BR></TD> </TR> <TR> <TD>C222</TD> <TD>Essendon Football Club</TD> <TD>10 Bomber Ave<BR> Windy Hill<BR> VIC 3666</TD> <TD><B>name</B> : Ray Horsburgh<BR> <B>office</B> : (03) 9111-9999<BR> <B>mobile</B> : 04111222444<BR></TD> </TR> <TR> <TD>C333</TD> <TD>KevinSheedy</TD> <TD>10 High St<BR> Essendon<BR> VIC 3622</TD> <TD><B>home</B> : (03) 9111-3333<BR> <B>office</B> : (03) 9111-9999<BR> <B>mobile</B> : 04111222444<BR></TD> </TR> <TR> <TD>C444</TD> <TD>JohnWorsfold</TD> <TD>23 Bayview Ave<BR> South Perth<BR> WA 6200</TD> <TD><B>home</B> : (06) 6222-3333<BR> <B>office</B> : (06) 6222-9999<BR> <B>mobile</B> : 04111222555<BR></TD> </TR> <TR> <TD>C555</TD> <TD>BenCousins</TD> <TD>23 Long Ave<BR> West Perth<BR> WA 6500</TD> <TD><B>home</B> : (06) 6222-4444<BR> <B>office</B> : (06) 6222-9999<BR> <B>mobile</B> : 04111222666<BR></TD> </TR> <TR> <TD>C666</TD> <TD>West Coast Football Club</TD> <TD>1 Eagle Dr<BR> Subiaco<BR> WA 6666</TD> <TD><B>name</B> : Dalton Gooding<BR> <B>office</B> : (06) 6222-9999<BR> <B>mobile</B> : 04111222555<BR></TD> </TR> </TABLE>
XMLfile.jpg 200x30

XSLTfile.jpg 200x30