jkesselm 02/05/16 17:00:48
Added: test/tests/conf/variable variable71.xml variable71.xsl
variable72.xml variable72.xsl
Log:
XPath navigation within an RTF -- in particular, make sure we
find the _correct_ RTF. This is an issue for Xalan since we
may have several RTFs housed within a single DTM object,
and in fact we did have a glitch which caused us to search the
wrong one in some cases.
Revision Changes Path
1.1 xml-xalan/test/tests/conf/variable/variable71.xml
Index: variable71.xml
===================================================================
<?xml version="1.0"?>
<doc>
<t0>begin
<t1>content1</t1>
<t2>content2</t2>
<t1>extra1</t1>
</t0>
</doc>
1.1 xml-xalan/test/tests/conf/variable/variable71.xsl
Index: variable71.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:ex="http://xml.apache.org/xalan"
extension-element-prefixes="ex">
<!-- FileName: variable71 -->
<!-- Document: http://www.w3.org/TR/xslt -->
<!-- DocVersion: 19991116 -->
<!-- Section: 11.4 -->
<!-- Creator: David Marston -->
<!-- Purpose: Ensure that traversal of global RTF gets the right one. -->
<xsl:output method="xml" indent="no" encoding="UTF-8"/>
<xsl:variable name="top1">
<t0>top1-begin
<t1>top1-first1</t1>
<t2>top1-first2</t2>
<t1>top1-second1</t1>
</t0>
</xsl:variable>
<xsl:variable name="top2">
<t0>top2-begin
<t1>top2-first1</t1>
<t2>top2-first2</t2>
<t1>top2-second1</t1>
</t0>
</xsl:variable>
<xsl:template match="doc">
<out>
<!-- First, force evaluation of each variable -->
<junk>
<xsl:text>$top1 summary: </xsl:text>
<xsl:value-of select="$top1"/>
<xsl:text>
</xsl:text>
<xsl:text>$top2 summary: </xsl:text>
<xsl:value-of select="$top2"/>
</junk>
<xsl:text>
</xsl:text>
<xsl:text>The t1 elements in $top2 are </xsl:text>
<xsl:for-each select="ex:nodeset($top2)//t2/preceding::t1">
<xsl:value-of select="."/>
<xsl:text>,</xsl:text>
</xsl:for-each>
</out>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/variable/variable72.xml
Index: variable72.xml
===================================================================
<?xml version="1.0"?>
<doc>
<t0>begin
<t1>content1</t1>
<t2>content2</t2>
<t1>extra1</t1>
</t0>
</doc>
1.1 xml-xalan/test/tests/conf/variable/variable72.xsl
Index: variable72.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:ex="http://xml.apache.org/xalan"
extension-element-prefixes="ex">
<!-- FileName: variable72 -->
<!-- Document: http://www.w3.org/TR/xslt -->
<!-- DocVersion: 19991116 -->
<!-- Section: 11.4 -->
<!-- Creator: David Marston -->
<!-- Purpose: Ensure that traversal of local RTF gets the right one. -->
<xsl:output method="xml" indent="no" encoding="UTF-8"/>
<xsl:template match="doc">
<!-- Define a couple variables -->
<xsl:variable name="var1">
<t0>var1-begin
<t1>var1-first1</t1>
<t2>var1-first2</t2>
<t1>var1-second1</t1>
</t0>
</xsl:variable>
<xsl:variable name="var2">
<t0>var2-begin
<t1>var2-first1</t1>
<t2>var2-first2</t2>
<t1>var2-second1</t1>
</t0>
</xsl:variable>
<out>
<!-- First, force evaluation of each variable -->
<junk>
<xsl:text>$var1 summary: </xsl:text>
<xsl:value-of select="$var1"/>
<xsl:text>
</xsl:text>
<xsl:text>$var2 summary: </xsl:text>
<xsl:value-of select="$var2"/>
</junk>
<xsl:text>
</xsl:text>
<xsl:text>The t1 elements in $var2 are </xsl:text>
<xsl:for-each select="ex:nodeset($var2)//t2/preceding::t1">
<xsl:value-of select="."/>
<xsl:text>,</xsl:text>
</xsl:for-each>
</out>
</xsl:template>
</xsl:stylesheet>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]