|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Problem with Saxon 7.9.1 xsl:variable and selecting a
Hi,
I'm using Saxon 7.9.1 to transform some xml. Within this transformation I set a variable to a node. Somewhat later I try to select a value from a subnode of this variable node, but it gives me nothing. With the XML-Spy engine this works for me, but not with Saxon 7.9.1 (which I have to use for some other reasons). So If someone could give me an advice how to do this with saxon 7.9.1 or what else to do. I would be very grateful if someone could help me. Regards Olaf
======================
This is the tinytest.xsl xml style sheet:
-----------------------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:myns="http://www.example.com/NameSpace">
<xsl:template match="/">
<myNexDoc>
<version>
version: <xsl:value-of select="system-property('xsl:version')" />
vendor: <xsl:value-of select="system-property('xsl:vendor')" />
vendor-url: <xsl:value-of select="system-property('xsl:vendor-url')" />
product: <xsl:value-of select="system-property('xsl:product')" />
product-version: <xsl:value-of
select="system-property('xsl:product-version')" />
</version>
<xsl:apply-templates select="//myns:content" mode="content" />
</myNexDoc>
</xsl:template>
<xsl:template match="myns:content" mode="content">
<xsl:variable name="thissection" >
<xsl:sequence select="../myns:section"/>
</xsl:variable>
<mysection>
<xsl:attribute name="origSectionId">
<xsl:value-of select="$thissection/myns:id"/>
</xsl:attribute>
</mysection>
<somedummy>dummy content</somedummy>
</xsl:template>
</xsl:stylesheet>========================== Here is the XML-Spy result (pritty print)(which is what I'm expecting): With the right value for mysection/@origSectionId --------------------------- <?xml version="1.0" encoding="UTF-8"?> <myNexDoc xmlns:myns="http://www.example.com/NameSpace"> <version> version: 2.0 vendor: Altova GmbH vendor-url: http://www.altova.com product: product-version: </version> <mysection origSectionId="100" /> <somedummy>dummy content</somedummy> </myNexDoc> =========================== Here is the Saxon result (pritty print) With the empty value for mysection/@origSectionId -------------------------- <?xml version="1.0" encoding="UTF-8"?> <myNexDoc xmlns:myns="http://www.example.com/NameSpace"> <version> version: 2.0 vendor: SAXON 7.9.1 from Saxonica vendor-url: http://saxon.sf.net/ product: product-version: 7.9.1</version> <mysection origSectionId=""/> <somedummy>dummy content</somedummy> </myNexDoc> ============================
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








