Re: node-set() function in MSXML?

Subject: Re: node-set() function in MSXML?
From: "Steve Muench" <smuench@xxxxxxxxxxxxx>
Date: Tue, 1 Aug 2000 18:53:09 -0700
| If MSXML complied with the standard, I would be able to write a
| stylesheet that uses fallbacks to invoke the appropriate node-set() function
| based on which processor was being used.  But since MSXML is not compliant,
| I can't write a stylesheet that will work for it and for a compliant
| processor.  At least that's my understanding at this point.

Not the most elegant in the world, but this stylesheet
is a tweaked example of my earlier one that works on
both MSXSL3 and OracleXSL. Similar strategy could be
used for adding compatibility with other engines like
Saxon, XT, Xalan, etc.

<test xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
      xmlns:ora="http://www.oracle.com/XSL/Transform/java/";
      xsl:exclude-result-prefixes="ora">
  <xsl:variable name="x">
    <a>
      <b>one</b>
      <b>two</b>
    </a>
  </xsl:variable>
  <xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
  <xsl:choose>
    <!-- Let MSXSL3 coerce RTF in $x to nodeset -->
    <xsl:when test="contains($vendor,'Microsoft')">
      <xsl:for-each select="$x/a/b">
        <c><xsl:value-of select="."/></c>
      </xsl:for-each>
    </xsl:when>
    <!-- Use built-in ora:node-set() extension function -->
    <xsl:when test="contains($vendor,'Oracle')">
      <xsl:for-each select="ora:node-set($x)/a/b">
        <c><xsl:value-of select="."/></c>
      </xsl:for-each>
    </xsl:when>
  </xsl:choose>
</test>

______________________________________________________________
Steve Muench, Lead XML Evangelist & Consulting Product Manager
BC4J & XSQL Servlet Development Teams, Oracle Rep to XSL WG
Author "Building Oracle XML Applications", O'Reilly
http://www.oreilly.com/catalog/orxmlapp/



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread