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/02/26 21:46:58 UTC
cvs commit: xml-xalan/test/tests/conf/idkey idkey59.xsl idkey57.xsl idkey58.xml idkey58.xsl idkey59.xml idkey57.xml
dmarston 02/02/26 12:46:57
Added: test/tests/conf/idkey idkey59.xsl idkey57.xsl idkey58.xml
idkey58.xsl idkey59.xml idkey57.xml
Log:
Expand coverage of the argument to id(), and add another
variation on "use" in xsl:key, courtesy of Frank Weiss.
Revision Changes Path
1.1 xml-xalan/test/tests/conf/idkey/idkey59.xsl
Index: idkey59.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- FileName: idkey59 -->
<!-- Document: http://www.w3.org/TR/xslt -->
<!-- DocVersion: 19991116 -->
<!-- Section: 12.2 -->
<!-- Creator: Frank Weiss -->
<!-- Purpose: Test xsl:key with union in "use" attribute. -->
<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
<xsl:key name="key1" match="div" use="x | y | z"/>
<xsl:template match="/">
<out>
<h1>Coordinate 25 (4 hits, 3 sections):</h1>
<xsl:for-each select="key('key1', 25)">
<title>
<xsl:value-of select="title"/>
</title>
</xsl:for-each>
<h1>Coordinate 39 (1 hit):</h1>
<xsl:for-each select="key('key1', 39)">
<title>
<xsl:value-of select="title"/>
</title>
</xsl:for-each>
<h1>Coordinate 44 (2 hits, 2 sections):</h1>
<xsl:for-each select="key('key1', 44)">
<title>
<xsl:value-of select="title"/>
</title>
</xsl:for-each>
<h1>Coordinate 75 (2 hits, 2 sections):</h1>
<xsl:for-each select="key('key1', 75)">
<title>
<xsl:value-of select="title"/>
</title>
</xsl:for-each>
</out>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/idkey/idkey57.xsl
Index: idkey57.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- FileName: idkey57 -->
<!-- Document: http://www.w3.org/TR/xpath -->
<!-- DocVersion: 19991116 -->
<!-- Section: 4.1 -->
<!-- Creator: David Marston -->
<!-- Purpose: Test for id(node-set), where node-set has a string with a list of ID values. -->
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:template match="/">
<out>
<xsl:for-each select="id(main/@list)">
<xsl:value-of select="."/>
</xsl:for-each>
</out>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/idkey/idkey58.xml
Index: idkey58.xml
===================================================================
<?xml version="1.0"?>
<!DOCTYPE main [
<!ELEMENT main (a*)>
<!ELEMENT a (#PCDATA)>
<!ATTLIST a id ID #REQUIRED>
]>
<main>
<a id="w">W</a>
<a id="x">X</a>
<a id="y">Y</a>
<a id="z">Z</a>
</main>
1.1 xml-xalan/test/tests/conf/idkey/idkey58.xsl
Index: idkey58.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- FileName: idkey58 -->
<!-- Document: http://www.w3.org/TR/xpath -->
<!-- DocVersion: 19991116 -->
<!-- Section: 4.1 -->
<!-- Creator: David Marston -->
<!-- Purpose: Test for id($var), where $var has a string with a list of ID values. -->
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:variable name="list" select="'z w x'"/>
<xsl:template match="/">
<out>
<xsl:for-each select="id($list)">
<xsl:value-of select="."/>
</xsl:for-each>
</out>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/idkey/idkey59.xml
Index: idkey59.xml
===================================================================
<?xml version="1.0" encoding="UTF-8" ?>
<doc>
<div>
<title>Introduction</title>
<x>25</x>
<y>39</y>
<z>25</z>
<p>Intro Section</p>
<q>1</q>
</div>
<div>
<title>Structure</title>
<x>14</x>
<y>89</y>
<z>75</z>
<p>Struc Section</p>
<q>2</q>
</div>
<div>
<title>Expressions</title>
<x>44</x>
<y>25</y>
<z>46</z>
<p>Exp Section</p>
<q>3</q>
</div>
<div>
<title>Numbers</title>
<x>25</x>
<y>44</y>
<z>75</z>
<p>Num Section</p>
<q>3.7</q>
</div>
</doc>
1.1 xml-xalan/test/tests/conf/idkey/idkey57.xml
Index: idkey57.xml
===================================================================
<?xml version="1.0"?>
<!DOCTYPE main [
<!ELEMENT main (a*)>
<!ATTLIST main list CDATA #REQUIRED>
<!ELEMENT a (#PCDATA)>
<!ATTLIST a id ID #REQUIRED>
]>
<main list="y w z">
<a id="w">W</a>
<a id="x">X</a>
<a id="y">Y</a>
<a id="z">Z</a>
</main>
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org