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...@locus.apache.org on 2000/12/16 03:14:54 UTC
cvs commit: xml-xalan/test/tests/conf/ver/err vererr09.xsl vererr01.xsl vererr02.xml vererr02.xsl vererr03.xml vererr03.xsl vererr04.xml vererr04.xsl vererr05.xml vererr05.xsl vererr06.xml vererr06.xsl vererr07.xml vererr07.xsl vererr08.xml vererr08.xsl vererr09.xml vererr01.xml
dmarston 00/12/15 18:14:54
Added: test/tests/conf/ver/err vererr09.xsl vererr01.xsl
vererr02.xml vererr02.xsl vererr03.xml vererr03.xsl
vererr04.xml vererr04.xsl vererr05.xml vererr05.xsl
vererr06.xml vererr06.xsl vererr07.xml vererr07.xsl
vererr08.xml vererr08.xsl vererr09.xml vererr01.xml
Log:
Copy of tests in Lotus/IBM repository
Revision Changes Path
1.1 xml-xalan/test/tests/conf/ver/err/vererr09.xsl
Index: vererr09.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- FileName: VERerr09 -->
<!-- Document: http://www.w3.org/TR/xslt -->
<!-- DocVersion: 19991116 -->
<!-- Section: 2.2 -->
<!-- Creator: David Marston -->
<!-- Purpose: Test that version number is required. -->
<!-- ExpectedException: stylesheet must have version attribute -->
<xsl:template match="/">
<out>
Choosing, based on value of version property.
<xsl:choose>
<xsl:when test="system-property('xsl:version') >= 1.0">
We are ready to use the 1.0 feature.
</xsl:when>
<xsl:otherwise>
We didn't try to use the 1.0 feature, but we should have.
<xsl:message>This stylesheet requires XSLT 1.0 or higher</xsl:message>
</xsl:otherwise>
</xsl:choose>
</out>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/ver/err/vererr01.xsl
Index: vererr01.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- FileName: VERerr01 -->
<!-- Document: http://www.w3.org/TR/xslt -->
<!-- DocVersion: 19991116 -->
<!-- Section: 2.5 Forwards-Compatible Processing -->
<!-- Creator: David Marston -->
<!-- Purpose: Test validation when version matches supported version. -->
<!-- ExpectedException: Unknown XSL element: exciting-new-8.5-feature -->
<!-- ExpectedException: org.apache.xalan.xslt.XSLProcessorException: Unknown XSL element: exciting-new-8.5-feature -->
<xsl:template match="/">
<out>
Choosing, based on value of version property.
<xsl:choose>
<xsl:when test="system-property('xsl:version') >= 1.0">
We are trying to use the 8.5 feature in an earlier version.
<xsl:exciting-new-8.5-feature/>
</xsl:when>
<xsl:otherwise>
We didn't try to use the 8.5 feature, but we should have.
<xsl:message>This stylesheet requires XSLT 1.0 or higher</xsl:message>
</xsl:otherwise>
</xsl:choose>
</out>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/ver/err/vererr02.xml
Index: vererr02.xml
===================================================================
<?xml version="1.0"?>
<doc>
</doc>
1.1 xml-xalan/test/tests/conf/ver/err/vererr02.xsl
Index: vererr02.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="0.5">
<!-- FileName: VERerr02 -->
<!-- Document: http://www.w3.org/TR/xslt -->
<!-- DocVersion: 19991116 -->
<!-- Section: 2.5 Forwards-Compatible Processing -->
<!-- Creator: David Marston -->
<!-- Purpose: Test validation when version is lower than supported version. -->
<!-- ExpectedException: Unknown XSL element: exciting-new-8.5-feature -->
<!-- ExpectedException: org.apache.xalan.xslt.XSLProcessorException: Unknown XSL element: exciting-new-8.5-feature -->
<xsl:template match="/">
<out>
Choosing, based on value of version property.
<xsl:choose>
<xsl:when test="system-property('xsl:version') >= 0.5">
We are trying to use the 8.5 feature in an earlier version.
<xsl:exciting-new-8.5-feature/>
</xsl:when>
<xsl:otherwise>
We didn't try to use the 8.5 feature, but we should have.
<xsl:message>This stylesheet requires XSLT 0.5 or higher</xsl:message>
</xsl:otherwise>
</xsl:choose>
</out>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/ver/err/vererr03.xml
Index: vererr03.xml
===================================================================
<?xml version="1.0"?>
<doc>
<version theattrib="39"/>
</doc>
1.1 xml-xalan/test/tests/conf/ver/err/vererr03.xsl
Index: vererr03.xsl
===================================================================
<?xml version="1.0"?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- FileName: VERerr03 -->
<!-- Document: http://www.w3.org/TR/xslt -->
<!-- DocVersion: 19991116 -->
<!-- Section: 2.2 Stylesheet element -->
<!-- Creator: David Marston -->
<!-- Purpose: Don't allow transform to be matched with stylesheet. -->
<!-- ExpectedException: The element type "xsl:transform" must be terminated by the matching end-tag "</xsl:transform>". -->
<!-- ExpectedException: org.apache.xalan.xslt.XSLProcessorException: The element type "xsl:transform" must be terminated by the matching end-tag "</xsl:transform>". -->
<!-- Explicitly match text nodes so the output is just 39 -->
<xsl:template match="text()">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="doc/version">
<out>
<xsl:value-of select="./@theattrib"/>
</out>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/ver/err/vererr04.xml
Index: vererr04.xml
===================================================================
<?xml version="1.0"?>
<doc>
<version theattrib="39"/>
</doc>
1.1 xml-xalan/test/tests/conf/ver/err/vererr04.xsl
Index: vererr04.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- FileName: VERerr04 -->
<!-- Document: http://www.w3.org/TR/xslt -->
<!-- DocVersion: 19991116 -->
<!-- Section: 2.2 Stylesheet element -->
<!-- Creator: David Marston -->
<!-- Purpose: Don't allow xsl:stylesheet inside the stylesheet element. -->
<!-- ExpectedException: cannot nest one stylesheet/transform inside another -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="doc">
<out>
This is from the nested stylesheet
</out>
</xsl:template>
</xsl:stylesheet>
<xsl:template match="doc">
<out>
Should have an error before this prints
</out>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/ver/err/vererr05.xml
Index: vererr05.xml
===================================================================
<?xml version="1.0"?>
<doc>
</doc>
1.1 xml-xalan/test/tests/conf/ver/err/vererr05.xsl
Index: vererr05.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- FileName: VERerr05 -->
<!-- Document: http://www.w3.org/TR/xslt -->
<!-- DocVersion: 19991116 -->
<!-- Section: 2.1 XSLT Namespace -->
<!-- Creator: David Marston -->
<!-- Purpose: Test use of an undefined element (garbage) as if was part of XSLT. -->
<!-- ExpectedException: Unknown XSL element: garbage -->
<!-- ExpectedException: org.apache.xalan.xslt.XSLProcessorException: Unknown XSL element: garbage -->
<xsl:template match="/">
<out>
The garbage element is not part of XSLT!
<xsl:garbage/>
</out>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/ver/err/vererr06.xml
Index: vererr06.xml
===================================================================
<?xml version="1.0"?>
<doc>
<version theattrib="39"/>
</doc>
1.1 xml-xalan/test/tests/conf/ver/err/vererr06.xsl
Index: vererr06.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- FileName: VERerr06 -->
<!-- Document: http://www.w3.org/TR/xslt -->
<!-- DocVersion: 19991116 -->
<!-- Section: 2.2 Stylesheet element -->
<!-- Creator: David Marston -->
<!-- Purpose: Don't allow xsl:stylesheet inside a template. -->
<!-- ExpectedException: Cannot nest stylesheet/transform inside other elements -->
<xsl:template match="doc">
<out>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:text>This is from the nested stylesheet</xsl:text>
</xsl:stylesheet>
</out>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/ver/err/vererr07.xml
Index: vererr07.xml
===================================================================
<?xml version="1.0"?>
<doc>
<version theattrib="39"/>
</doc>
1.1 xml-xalan/test/tests/conf/ver/err/vererr07.xsl
Index: vererr07.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- FileName: VERerr07 -->
<!-- Document: http://www.w3.org/TR/xslt -->
<!-- DocVersion: 19991116 -->
<!-- Section: 2.2 Stylesheet element -->
<!-- Creator: David Marston -->
<!-- Purpose: Don't allow xsl:transform inside a template. -->
<!-- ExpectedException: Cannot nest stylesheet/transform inside other elements -->
<xsl:template match="doc">
<out>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:text>This is from the nested stylesheet</xsl:text>
</xsl:transform>
</out>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/ver/err/vererr08.xml
Index: vererr08.xml
===================================================================
<?xml version="1.0"?>
<doc>
<version theattrib="39"/>
</doc>
1.1 xml-xalan/test/tests/conf/ver/err/vererr08.xsl
Index: vererr08.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- FileName: VERerr08 -->
<!-- Document: http://www.w3.org/TR/xslt -->
<!-- DocVersion: 19991116 -->
<!-- Section: 2.2 Stylesheet element -->
<!-- Creator: David Marston -->
<!-- Purpose: Don't allow xsl:transform inside the stylesheet element. -->
<!-- ExpectedException: cannot nest one stylesheet/transform inside another -->
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="doc">
<out>
This is from the nested stylesheet
</out>
</xsl:template>
</xsl:transform>
<xsl:template match="doc">
<out>
Should have an error before this prints
</out>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/ver/err/vererr09.xml
Index: vererr09.xml
===================================================================
<?xml version="1.0"?>
<doc>
</doc>
1.1 xml-xalan/test/tests/conf/ver/err/vererr01.xml
Index: vererr01.xml
===================================================================
<?xml version="1.0"?>
<doc>
</doc>