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 2003/01/15 21:12:15 UTC
cvs commit: xml-xalan/test/tests/conf/position position111.xsl position111.xml
dmarston 2003/01/15 12:12:15
Added: test/tests/conf/position position111.xsl position111.xml
Log:
Neglected aspect of data model (XPath chapter 5)
will now be tested
Revision Changes Path
1.1 xml-xalan/test/tests/conf/position/position111.xsl
Index: position111.xsl
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- FileName: position111 -->
<!-- Document: http://www.w3.org/TR/xpath -->
<!-- DocVersion: 19991116 -->
<!-- Section: 5 -->
<!-- Creator: David Bertoni, amended by David Marston -->
<!-- Purpose: Data Model requires that namespace nodes precede attribute nodes. -->
<xsl:output encoding="UTF-8" method="xml" indent="no"/>
<xsl:template match="Doc">
<out>
<xsl:for-each select="namespace::* | attribute::*" >
<xsl:choose>
<xsl:when test="contains(.,'http')">
<!-- it's a namespace node -->
<xsl:if test="position() <= 3">
<xsl:text> OK</xsl:text>
</xsl:if>
</xsl:when>
<xsl:when test="contains(.,'attr')">
<!-- it's an attribute node -->
<xsl:if test="position() > 3">
<xsl:text> OK</xsl:text>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:text> BAD VALUE: </xsl:text><xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</out>
</xsl:template>
</xsl:stylesheet>
1.1 xml-xalan/test/tests/conf/position/position111.xml
Index: position111.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<Doc bar:foo1="attr1" xmlns:bar="http://example.org/bar" bar:foo2="attr2"
xmlns:foo="http://example.org/foo"/>
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org