Subject: [xsl] Testing Transformation Filter - does this XML/XSLT work? From: Julian Voelcker <asp@xxxxxxx> Date: Fri, 28 Jan 2005 15:55:05 GMT |
I am trying to test some ASP.Net transformation code that I have, but being a novice have no idea if the XML/XLST combination is correct. Here are the files that I am using - I get the page rendered, but not any of the courses -any ideas. XML: <?xml version="1.0" encoding="UTF-8" ?> <root> <courses> <state name="Arizona" code="AZ"> <course id="AZ-1" name="Pinetop Lakes Golf & CC" /> <course id="AZ-2" name="Ocotillo" /> <course id="AZ-3" name="White Mountain CC" /> </state> <state name="California" code="CA"> <course id="CA-1" name="Pebble Beach" /> <course id="CA-2" name="Spy Glass" /> <course id="CA-3" name="Los Angeles CC" /> </state> <state name="Florida" code="FL"> <course id="FL-1" name="TPC Sawgrass" /> <course id="FL-2" name="Disney" /> </state> </courses> </root> XSLT: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" version="1.0" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" indent="yes"/> <xsl:param name="code"/> <xsl:template match="/"> <xsl:apply-templates/> </xsl:template> <xsl:template match="root"> <html lang="eng" xml:lang="eng" xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Book a Tee Time</title> <link rel="stylesheet" type="text/css" href="/TeeTimes/style/style.css"/> <script language="javascript" src="/TeeTimes/scripts/scripts.js" type="text/javascript"/> </head> <body bgcolor="#FFFFFF"> <table border="0" width="640" class="borders" cellpadding="3" cellspacing="0" bgcolor="#e6e6cc"> <tr valign="top" align="left" bgcolor="#007900"> <td colspan="2"> <font face="Arial, Helvetica, sans-serif" size="5" color="#e6e6cc"> <b> <xsl:value-of select="//state[@code=$code]/@name"/>Courses:</b> </font> </td> </tr> <tr> <td width="10%"> <img src="/TeeTimes/images/golfer.jpg" alt=" "/> </td> <td valign="top" align="center"> <xsl:apply-templates/> </td> </tr> </table> </body> </html> </xsl:template> <xsl:template match="courses"> <xsl:apply-templates select="state[@code = $code]"/> </xsl:template> <xsl:template match="state"> <table border="0" width="95%" cellpadding="5"> <tr> <xsl:for-each select="course"> <xsl:sort select="@code" order="ascending"/> <a href="/TeeTimes/bookTime.aspx?course={@id}" class="course"> <xsl:value-of select="@name"/> </a> <br/> </xsl:for-each> </tr> </table> </xsl:template> </xsl:stylesheet> Any pointers would be appreciated. -- Cheers, Julian Voelcker United Kingdom
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] namespace reference in xs, Karjala Koponen | Thread | Re: [xsl] Testing Transformation Fi, Robert Koberg |
RE: [xsl] namespace reference in xs, Karjala Koponen | Date | Re: [xsl] Testing Transformation Fi, Robert Koberg |
Month |