Print

Print


I think that this has to do with a vagueness in the XSLT 1.0 spec.  The
problem is that the variable $langCodes is being used as if it were of type
node-set.  An xsl:variable in MSXML cannot return a node-set and the
"$langCodes/" is using the variable as if it were a node-set.  It is
possible to coerce the variable in MSXML to be a node-set but that's
non-standard.  You might be able to rewrite the transform with
function-available() or system-property() to make it work in either case.
However, in XSLT 2.0 you will be able to coerce a variable to a node-set in
a standard manner.

Andy.

-----Original Message-----
From: Reese, Terry [mailto:[log in to unmask]]
Sent: Tuesday, March 02, 2004 1:30 PM
To: [log in to unmask]
Subject: [MODS] MOD3 xsl problems using msxml4 parser



I had a quick question regarding the use of the new MODS3 xslt with
Microsoft's MSXML4 parser.  I use the MODS format to store data in an
internal SQL database, so when the v3 sheet was made available, I started
looking to change the processing scripts.  The problem that I'm running into
though, is that the MSXML parser seems to believe that the following section
is not valid (or at least, won't allow stylesheet to be set as long as this
section is present).  I've marked the affected section in red:

                <xsl:for-each select="marc:datafield[@tag=041]">

                        <xsl:variable name="langCodes">
                                <xsl:copy-of
select="marc:subfield[@code='a'or @code='d' or @code='e' or @code='2']"/>
                        </xsl:variable>
                         <xsl:choose>
                                <--XSL:WHEN TEST STOPPING THE MSXML
TRANSFORMATION-->
                                <xsl:when
test="$langCodes/child::*[@code='2']='rfc3066'">
                                ....
                        </xsl:choose>

                </xsl:for-each>

To get the stylesheet to work with the msxml4 parser, I simply had to do the
following:

                <xsl:for-each select="marc:datafield[@tag=041]">

                        <xsl:variable name="langCodes">
                                <xsl:copy-of
select="marc:subfield[@code='a'or @code='d' or @code='e' or @code='2']"/>
                        </xsl:variable>
                         <xsl:choose>
                                <!--<xsl:when
test="$langCodes/child::*[@code='2']='rfc3066'">-->
                                <xsl:when
test="../marc:subfield[@code='2']='rfc3066'">
                                ....
                        </xsl:choose>

                </xsl:for-each>

Since the stylesheet has worked with SAXON, I'm assuming that this is a
MSXML issue and just wanted to see if others may have had similar
experiences.

--Terry


****************************************************************************
***********
Terry Reese
Oregon State University Libraries
Cataloger for Networked Resources
Digital Production Unit Head
Oregon State University
Corvallis, Or  97331
Phone: 541-737-6384
Fax: 541-737-8267
[log in to unmask]
 <http://oregonstate.edu/~reeset/> http://oregonstate.edu/~reeset/
****************************************************************************
**********