[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Testing Transformation Filter - does this XML/XSLT work ?

Subject: RE: [xsl] Testing Transformation Filter - does this XML/XSLT work ?
From: Pieter Reint Siegers Kort <pieter.siegers@xxxxxxxxxxx>
Date: Fri, 28 Jan 2005 11:02:12 -0600

Hi Julian,

I think the following line in your XSLT is causing the behaviour (nothing

  <html lang="eng" xml:lang="eng" xmlns="http://www.w3.org/1999/xhtml">

If you change it to:

  <html lang="eng" xml:lang="eng">

Then it seems to work.

Appearently xmlns="http://www.w3.org/1999/xhtml" makes the difference.


-----Original Message-----
From: Julian Voelcker [mailto:asp@xxxxxxx] 
Sent: Friday, January 28, 2005 9:55 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] Testing Transformation Filter - does this XML/XSLT work?

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 version="1.0" encoding="UTF-8" ?>
  <state name="Arizona" code="AZ">
   <course id="AZ-1" name="Pinetop Lakes Golf &amp; CC" />
   <course id="AZ-2" name="Ocotillo" />
   <course id="AZ-3" name="White Mountain CC" />
  <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 name="Florida" code="FL">
   <course id="FL-1" name="TPC Sawgrass" />
   <course id="FL-2" name="Disney" />

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
 <xsl:output method="html" version="1.0" doctype-public="-//W3C//DTD XHTML
1.0 Transitional//EN"
indent="yes"/>  <xsl:param name="code"/>  <xsl:template match="/">
 <xsl:template match="root">
  <html lang="eng" xml:lang="eng" xmlns="http://www.w3.org/1999/xhtml">
    <title>Book a Tee Time</title>
    <link rel="stylesheet" type="text/css"
    <script language="javascript" src="/TeeTimes/scripts/scripts.js"
   <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">
         <xsl:value-of select="//state[@code=$code]/@name"/>Courses:</b>
      <td width="10%">
       <img src="/TeeTimes/images/golfer.jpg" alt=" "/>
      <td valign="top" align="center">
 <xsl:template match="courses">
  <xsl:apply-templates select="state[@code = $code]"/>  </xsl:template>
<xsl:template match="state">
  <table border="0" width="95%" cellpadding="5">
    <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"/>

Any pointers would be appreciated.

Julian Voelcker
United Kingdom

Current Thread