On Fri, 2004-10-08 at 15:56, [EMAIL PROTECTED] wrote:
> Hi Richard,
> 
> This does look like a bug in Xalan-J.  However, you can avoid using the 
> node-set extension function, if modify your stylesheet: slightly:
<snipped for brevity>
> 
> It might help you as a workaround for the problem, and is also more 
> portable than relying on an extension function.

I made the change you suggested, but my test case behaves the same as
before.  Perhaps the problem is deeper then just the nodeset()
extension?
<?xml version="1.0" encoding="UTF-8"?>
<records schema_revision="original"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="sp.xsd">
        <provider>
            <name>Florida</name>
            <state>fl</state>
        </provider>
        <provider>
            <name>Michigan</name>
            <state>mi</state>
        </provider>
</records>
<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
exclude-result-prefixes="xalan"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:xalan="http://xml.apache.org/xalan";
xmlns:bowman="http://www.bowmansystems.com";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  <xsl:output method="xml" indent="yes"/>

  <bowman:state_abbrev_list>
     <state long="alabama">al</state>
     <state long="florida">fl</state>
     <state long="michigan">mi</state>
  </bowman:state_abbrev_list>
  <xsl:variable name="state_nodes"  select="document('')/xsl:stylesheet/bowman:state_abbrev_list" />
  <xsl:variable name="valid_states" select="$state_nodes/state/@long | $state_nodes/state"/>

  <xsl:template match="/records">
        <!-- this only pulls providers who have a valid state in either the physical or mailing address AND have a valid zip code AND have at provides at least one service code of type AIRS that does not start with a 'Y' -->
        <xsl:for-each select="provider[state = $valid_states]">
            <provider>
                <name><xsl:value-of select="name"/></name>
            </provider>
        </xsl:for-each>
  </xsl:template>
</xsl:stylesheet>

<?xml version="1.0" encoding="UTF-8"?>
<records schema_revision="original"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="sp.xsd">
        <provider>
            <name>Michigan</name>
            <state>mi</state>
        </provider>
        <provider>
            <name>Florida</name>
            <state>fl</state>
        </provider>
</records>

Reply via email to