You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by dm...@apache.org on 2002/05/15 21:51:32 UTC
cvs commit: xml-xalan/test/tests/conf/select select84.xsl select81.xsl select82.xml select82.xsl select83.xml select83.xsl select84.xml select81.xml
dmarston 02/05/15 12:51:32
Added: test/tests/conf/select select84.xsl select81.xsl
select82.xml select82.xsl select83.xml select83.xsl
select84.xml select81.xml
Log:
More coverage of whole-tree (//whatever) XPaths
Revision Changes Path
1.1 xml-xalan/test/tests/conf/select/select84.xsl
Index: select84.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- FileName: select84 -->
<!-- Document: http://www.w3.org/TR/xpath -->
<!-- DocVersion: 19991116 -->
<!-- Section: 2.5 -->
<!-- Creator: David Marston -->
<!-- Purpose: Test //@* to get all attributes in the tree -->
<xsl:output method="xml" indent="no" encoding="UTF-8"/>
<xsl:template match="/">
<out>
<xsl:apply-templates select="/doc/b/bb/bbb" />
</out>
</xsl:template>
<xsl:template match="bbb">
<list><xsl:apply-templates select="//@*"/></list>
</xsl:template>
<xsl:template match="@*">
<xsl:text>
Node </xsl:text>
<xsl:value-of select="name(..)" />
<xsl:text> has </xsl:text>
<xsl:value-of select="." />
<xsl:text> in @</xsl:text>
<xsl:value-of select="name(.)" />
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/select/select81.xsl
Index: select81.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- FileName: select81 -->
<!-- Document: http://www.w3.org/TR/xpath -->
<!-- DocVersion: 19991116 -->
<!-- Section: 2.5 -->
<!-- Creator: Joe Kesselman -->
<!-- Purpose: Try absolute path when current node is in middle of tree -->
<xsl:output method="xml" indent="no" encoding="UTF-8"/>
<xsl:template match="/">
<out>
<xsl:apply-templates select="/para/font[@color='green']" />
</out>
</xsl:template>
<xsl:template match="font">
<rel><xsl:apply-templates select="..//text()" /></rel>
<abs><xsl:apply-templates select="//text()" /></abs>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/select/select82.xml
Index: select82.xml
===================================================================
<?xml version="1.0"?>
<doc>1<a>in-a</a>2<!-- upper comment -->
<b>3<bb>4<bbb>5</bbb>6</bb>7</b>
<!-- lower comment -->8<c>in-c</c>9
</doc>
1.1 xml-xalan/test/tests/conf/select/select82.xsl
Index: select82.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- FileName: select82 -->
<!-- Document: http://www.w3.org/TR/xpath -->
<!-- DocVersion: 19991116 -->
<!-- Section: 2.5 -->
<!-- Creator: David Marston -->
<!-- Purpose: Test //* to get all elements -->
<xsl:output method="xml" indent="no" encoding="UTF-8"/>
<xsl:template match="/">
<out>
<xsl:apply-templates select="/doc/b/bb/bbb" />
</out>
</xsl:template>
<xsl:template match="bbb">
<list><xsl:apply-templates select="//*" mode="list"/></list>
</xsl:template>
<xsl:template match="*" mode="list">
<xsl:value-of select="name()" />
<xsl:text>|</xsl:text>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/select/select83.xml
Index: select83.xml
===================================================================
<?xml version="1.0"?>
<doc x="on-doc">
<a x="on-a">in-a</a>
<b x="on-b">
<bb NO="on-bb">
<bbb x="on-bbb"/>
</bb>
</b>
<c x="on-c">in-c</c>
</doc>
1.1 xml-xalan/test/tests/conf/select/select83.xsl
Index: select83.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- FileName: select83 -->
<!-- Document: http://www.w3.org/TR/xpath -->
<!-- DocVersion: 19991116 -->
<!-- Section: 2.5 -->
<!-- Creator: David Marston -->
<!-- Purpose: Test //@x to get all attributes of a certain name -->
<xsl:output method="xml" indent="no" encoding="UTF-8"/>
<xsl:template match="/">
<out>
<xsl:apply-templates select="/doc/b/bb/bbb" />
</out>
</xsl:template>
<xsl:template match="bbb">
<list><xsl:apply-templates select="//@x"/></list>
</xsl:template>
<xsl:template match="@x">
<xsl:text>
Node </xsl:text>
<xsl:value-of select="name(..)" />
<xsl:text> has </xsl:text>
<xsl:value-of select="." />
<xsl:text> in @x</xsl:text>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/select/select84.xml
Index: select84.xml
===================================================================
<?xml version="1.0"?>
<doc d="on-doc">
<a aa="on-a">in-a</a>
<b x="on-b">
<bb y="on-bb">
<bbb z="on-bbb"/>
</bb>
</b>
<c cc="on-c">in-c</c>
</doc>
1.1 xml-xalan/test/tests/conf/select/select81.xml
Index: select81.xml
===================================================================
<?xml version="1.0"?>
<para>
<font color='red'>Hello</font>
<font color='green'>There</font>
<font color='blue'>World</font>
</para>
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org