View Single Post
  #4 (permalink)  
Old September 15th, 2005, 11:12 AM
mhkay's Avatar
mhkay mhkay is offline
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

OK, I'm not quite sure what your problem is. Here's a log of what I did.

1. Fix the xsl namespace declaration.

2. line 9, variable $ID isn't declared. Not sure what you had in mind here, I just took it out of the concat().

3. It complains saying the XML file isn't well-formed. The <subclass> tags aren't properly nested. I don't know how to correct it, but I'll try putting a <class> element around the whole thing.

4. I now get an output, which looks wrong, but I don't know what output you wanted so it's hard to correct. An obvious fault is that the value attribute is empty. Can't see what you intended here, because there's no property whose name is "startdate". Perhaps you meant date. Incidentally, 4/1/2002 is a bad way to write a date - do you mean 4th Jan or 1st April? Use 2002-01-04.

5. The other obvious problem is that there's no template to match the subclass named "noFaultProviderList", so the text is getting splatted into the output (that's what the default template does). I added a template rule <xsl:template match="subclass"/> to prevent this.

6. I also added <xsl:output method="html" indent="yes"/> so I can see better what's going on, and because you seem to be trying to output HTML.

7. I'm now getting output that looks like this:

<table>
   <tr>
      <td><input type="text" class="sm-medium" maxlength="10" name="assigneeDateOfServiceList..startDate" value=""></td>
      <td><select muliple="yes" size="1" name="providerList">
            <option value="2"></option></select></td>
   </tr>
</table>

Can't really do any more, because I don't know how that differs from the output you actually want.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference