dmarston 01/07/26 14:12:36
Added: test/tests/conf/position position90.xsl position85.xsl
position86.xml position86.xsl position87.xml
position87.xsl position88.xml position88.xsl
position89.xml position89.xsl position90.xml
position85.xml
Log:
In an XPath, parentheses affect how position() is calculated,
but the predicate is still applied "with respect to the child axis."
Revision Changes Path
1.1 xml-xalan/test/tests/conf/position/position90.xsl
Index: position90.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- FileName: position90 -->
<!-- Document: http://www.w3.org/TR/xpath -->
<!-- DocVersion: 19991116 -->
<!-- Section: 3.3 -->
<!-- Creator: David Marston, from remarks of Mukund Raghavachari (who read
Mike Kay) -->
<!-- Purpose: Test () grouping with expanded version of // axis. This test
attempts to
give an explicit representation of one possible fallacious
interpretation of
chapter//footnote[6]. -->
<xsl:output method="xml" encoding="utf-8"/>
<xsl:template match="/">
<out>
<xsl:for-each select="chapter/descendant::footnote[6]">
<greeting>
<xsl:value-of select="."/>
</greeting>
<xsl:text>
</xsl:text>
</xsl:for-each>
</out>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/position/position85.xsl
Index: position85.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- FileName: position85 -->
<!-- Document: http://www.w3.org/TR/xpath -->
<!-- DocVersion: 19991116 -->
<!-- Section: 3.1 -->
<!-- Creator: David Marston -->
<!-- Purpose: Test that () grouping can be applied multiple times. -->
<xsl:template match="/">
<out>
<xsl:for-each select="//baz">
<xsl:value-of select="ancestor::foo[1]/@att1"/><xsl:text>, </xsl:text>
<xsl:value-of select="(ancestor::foo[1])/@att1"/><xsl:text>, </xsl:text>
<xsl:value-of select="(ancestor::foo)[1]/@att1"/><xsl:text>, </xsl:text>
<xsl:value-of select="((ancestor::foo))[1]/@att1"/><xsl:text>,
</xsl:text>
<xsl:value-of select="(((ancestor::foo)[1])/@att1)"/>
</xsl:for-each>
</out>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/position/position86.xml
Index: position86.xml
===================================================================
<?xml version="1.0"?>
<chapter>
<section>
<footnote>hello</footnote>
</section>
<section>
<footnote>goodbye</footnote>
<footnote>sayonara</footnote>
</section>
<section>
<footnote>aloha</footnote>
</section>
</chapter>
1.1 xml-xalan/test/tests/conf/position/position86.xsl
Index: position86.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- FileName: position86 -->
<!-- Document: http://www.w3.org/TR/xpath -->
<!-- DocVersion: 19991116 -->
<!-- Section: 3.3 -->
<!-- Creator: Mukund Raghavachari -->
<!-- Purpose: "The Predicate filters the node-set with respect to the child
axis"
means that the descendant(-or-self) axes must be internally segregated
so that
the position is among one group of children. -->
<xsl:output method="xml" encoding="utf-8"/>
<xsl:template match="/">
<out>
<xsl:for-each select="chapter//footnote[1]">
<xsl:copy>
<xsl:value-of select="."/>
</xsl:copy>
<xsl:text>
</xsl:text>
</xsl:for-each>
</out>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/position/position87.xml
Index: position87.xml
===================================================================
<?xml version="1.0"?>
<chapter>
<section>
<footnote>hello</footnote>
<footnote>ahoy</footnote>
</section>
<section>
<footnote>goodbye</footnote>
<footnote>sayonara</footnote>
<footnote>adios</footnote>
</section>
<section>
<footnote>aloha</footnote>
<subsection>
<footnote>shalom</footnote>
<footnote>yo</footnote>
</subsection>
<footnote>ciao</footnote>
</section>
</chapter>
1.1 xml-xalan/test/tests/conf/position/position87.xsl
Index: position87.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- FileName: position87 -->
<!-- Document: http://www.w3.org/TR/xpath -->
<!-- DocVersion: 19991116 -->
<!-- Section: 3.3 -->
<!-- Creator: David Marston -->
<!-- Purpose: Show that predicate applies along child axis, not
descendant-or-self. -->
<xsl:output method="xml" encoding="utf-8"/>
<xsl:template match="/">
<out>
<xsl:for-each select="chapter//footnote[2]">
<greeting>
<xsl:value-of select="."/>
</greeting>
<xsl:text>
</xsl:text>
</xsl:for-each>
</out>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/position/position88.xml
Index: position88.xml
===================================================================
<?xml version="1.0"?>
<chapter>
<section>
<footnote>hello</footnote>
<footnote>ahoy</footnote>
</section>
<section>
<footnote>goodbye</footnote>
<footnote>sayonara</footnote>
<footnote>adios</footnote>
</section>
<section>
<footnote>aloha</footnote>
<subsection>
<footnote>shalom</footnote>
<footnote>yo</footnote>
</subsection>
<footnote>ciao</footnote>
</section>
</chapter>
1.1 xml-xalan/test/tests/conf/position/position88.xsl
Index: position88.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- FileName: position88 -->
<!-- Document: http://www.w3.org/TR/xpath -->
<!-- DocVersion: 19991116 -->
<!-- Section: 3.3 -->
<!-- Creator: David Marston, from remarks of Mukund Raghavachari (who read
Mike Kay) -->
<!-- Purpose: Test () grouping around // (descendant-or-self) axis. -->
<xsl:output method="xml" encoding="utf-8"/>
<xsl:template match="/">
<out>
<xsl:for-each select="(chapter//footnote)[2]">
<greeting>
<xsl:value-of select="."/>
</greeting>
<xsl:text>
</xsl:text>
</xsl:for-each>
</out>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/position/position89.xml
Index: position89.xml
===================================================================
<?xml version="1.0"?>
<chapter>
<section>
<footnote>hello</footnote>
</section>
<section>
<footnote>goodbye</footnote>
<footnote>sayonara</footnote>
<footnote>adios</footnote>
</section>
<section>
<footnote>aloha</footnote>
<subsection>
<footnote>shalom</footnote>
<footnote>yo</footnote>
</subsection>
<footnote>ciao</footnote>
</section>
</chapter>
1.1 xml-xalan/test/tests/conf/position/position89.xsl
Index: position89.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- FileName: position89 -->
<!-- Document: http://www.w3.org/TR/xpath -->
<!-- DocVersion: 19991116 -->
<!-- Section: 3.3 -->
<!-- Creator: David Marston, from remarks of Mukund Raghavachari (who read
Mike Kay) -->
<!-- Purpose: Test () grouping with expanded version of // axis. This test
attempts to
give an explicit representation of one possible fallacious
interpretation of
chapter//footnote[2]. -->
<xsl:output method="xml" encoding="utf-8"/>
<xsl:template match="/">
<out>
<xsl:for-each
select="(child::chapter/descendant-or-self::node())/footnote[2]">
<greeting>
<xsl:value-of select="."/>
</greeting>
<xsl:text>
</xsl:text>
</xsl:for-each>
</out>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/position/position90.xml
Index: position90.xml
===================================================================
<?xml version="1.0"?>
<chapter>
<section>
<footnote>hello</footnote>
</section>
<section>
<footnote>goodbye</footnote>
<footnote>sayonara</footnote>
<footnote>adios</footnote>
</section>
<footnote>auf wiedersehn</footnote>
<section>
<footnote>aloha</footnote>
<subsection>
<footnote>shalom</footnote>
<footnote>yo</footnote>
</subsection>
<footnote>ciao</footnote>
</section>
</chapter>
1.1 xml-xalan/test/tests/conf/position/position85.xml
Index: position85.xml
===================================================================
<?xml version="1.0"?>
<doc>
<foo att1="c">
<foo att1="b">
<foo att1="a">
<baz/>
</foo>
</foo>
</foo>
</doc>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]