dmarston 01/06/22 14:28:24
Added: test/tests/conf/modes modes15.xsl modes11.xsl modes12.xml
modes12.xsl modes13.xml modes13.xsl modes14.xml
modes14.xsl modes15.xml modes11.xml
Log:
NIST test cases and another contributed case
Revision Changes Path
1.1 xml-xalan/test/tests/conf/modes/modes15.xsl
Index: modes15.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- FileName: modes15 -->
<!-- Document: http://www.w3.org/TR/xslt -->
<!-- DocVersion: 19991116 -->
<!-- Section: 5.7 Modes -->
<!-- Purpose: Re-use nodes in different modes; templates have step-paths -->
<!-- Creator: Mingfei Peng ([EMAIL PROTECTED]), altered by David Marston -->
<!-- Within a given mode, there are situations when more than one template
will match. Normal conflict-resolution rules should apply. -->
<xsl:template match="/">
<out>
<xsl:apply-templates select="sss/sss" mode="c"/>
<xsl:apply-templates select="sss/sss" mode="d"/>
<xsl:apply-templates select="sss//i" mode="c"/>
<xsl:apply-templates select="sss//i" mode="d"/>
<xsl:apply-templates select="/sss/sss/i" mode="c"/>
<xsl:apply-templates select="/sss/sss/i" mode="d"/>
</out>
</xsl:template>
<xsl:template match="sss//*" mode="d">
!Any descendant of any sss!
</xsl:template>
<xsl:template match="/sss//*" mode="d">
+Any descendant of root sss+
</xsl:template>
<xsl:template match="sss/*" mode="c">
-Any child of any sss-
</xsl:template>
<xsl:template match="/sss/*" mode="c">
-Any child of root sss-
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/modes/modes11.xsl
Index: modes11.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- FileName: modes11 -->
<!-- Document: http://www.w3.org/TR/xslt -->
<!-- DocVersion: 19991116 -->
<!-- Section: 5.7 -->
<!-- Creator: Carmelo Montanez --><!-- Template001 in NIST suite -->
<!-- Purpose: Test apply-templates for a comment with a mode
and moded matching template. -->
<xsl:template match="doc">
<out>
<xsl:apply-templates select="comment()" mode="mode1"/>
</out>
</xsl:template>
<xsl:template match="comment()" mode="mode1">
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="comment()">
This test failed to execute properly.
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/modes/modes12.xml
Index: modes12.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<doc>
<?PITarget Processing-Instruction 1 type="text/xml"?>
</doc>
1.1 xml-xalan/test/tests/conf/modes/modes12.xsl
Index: modes12.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- FileName: modes12 -->
<!-- Document: http://www.w3.org/TR/xslt -->
<!-- DocVersion: 19991116 -->
<!-- Section: 5.7 -->
<!-- Creator: Carmelo Montanez --><!-- Template002 in NIST suite -->
<!-- Purpose: Test apply-templates for PI with a mode
and moded matching template. -->
<xsl:template match="doc">
<out>
<xsl:apply-templates select="processing-instruction()" mode="mode1"/>
</out>
</xsl:template>
<xsl:template match="processing-instruction()" mode="mode1">
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="processing-instruction()">
This test failed to execute properly.
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/modes/modes13.xml
Index: modes13.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<doc>
<child1>This is the child number 1.</child1>
</doc>
1.1 xml-xalan/test/tests/conf/modes/modes13.xsl
Index: modes13.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- FileName: modes13 -->
<!-- Document: http://www.w3.org/TR/xslt -->
<!-- DocVersion: 19991116 -->
<!-- Section: 5.7 -->
<!-- Creator: Carmelo Montanez --><!-- Template003 in NIST suite -->
<!-- Purpose: Test apply-templates for any node() with a mode
and moded matching template. -->
<xsl:template match="doc">
<out>
<xsl:apply-templates select="node()" mode="mode1"/>
</out>
</xsl:template>
<xsl:template match="node()" mode="mode1">
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="node()">
This test failed to execute properly.
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/modes/modes14.xml
Index: modes14.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<doc attribute1="attribute1"></doc>
1.1 xml-xalan/test/tests/conf/modes/modes14.xsl
Index: modes14.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- FileName: modes14 -->
<!-- Document: http://www.w3.org/TR/xslt -->
<!-- DocVersion: 19991116 -->
<!-- Section: 5.7 -->
<!-- Creator: Carmelo Montanez --><!-- Template004 in NIST suite -->
<!-- Purpose: Test apply-templates for an attribute with a mode
and moded matching template. -->
<xsl:template match="doc">
<out>
<xsl:apply-templates select="@attribute1" mode="mode1"/>
</out>
</xsl:template>
<xsl:template match="@attribute1" mode="mode1">
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="@attribute1">
This test failed to execute properly.
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/modes/modes15.xml
Index: modes15.xml
===================================================================
<?xml version="1.0"?>
<sss>
<sss><i>Not OK</i></sss>
</sss>
1.1 xml-xalan/test/tests/conf/modes/modes11.xml
Index: modes11.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<doc>
<!-- This test executed properly. -->
</doc>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]