[KLUG Members] XML/DSML/XSL Transform Help

Adam Tauno Williams adam at morrison-ind.com
Mon Nov 15 09:03:30 EST 2004


Okay, explain this.

If the document root tag is -
<batchResponse xmlns="urn:oasis:names:tc:DSML:2:0:core"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

then the XSLT doesn't work.

If I strip the document root tag down to just <batchResponse>, then it
works.  Eh?

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
  <ditData>
   <xsl:for-each
select="batchResponse/searchResponse/searchResultEntry">
    <object>
     <cn><xsl:value-of select="attr[@name='cn']/value"/></cn>
     <birthdate><xsl:value-of
select="attr[@name='birthday']/value"/></birthdate>
     <serialid><xsl:value-of
select="attr[@name='morrisonserialid']/value"/></serialid>
     <fileAs><xsl:value-of
select="attr[@name='fileAs']/value"/></fileAs>
     <startdate><xsl:value-of
select="attr[@name='morrisonpositionstartdate']/value"/></startdate>
    </object>
   </xsl:for-each>
  </ditData>
</xsl:template>
</xsl:stylesheet>




More information about the Members mailing list