xsl-list
[Top] [All Lists]

xsl:sequence produces error I cant understand

2004-10-10 12:44:36
Hi,

    The following code :

<?xml version="1.0"?>
<xsl:stylesheet version="2.0"
        xmlns:ns="urn:dummyNamespace"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

        <xsl:output omit-xml-declaration="yes" />

        <ns:root>
                <ns:child attr="x" />
                <ns:child attr="y" />
        </ns:root>

        <xsl:template match="/">
                <xsl:for-each
select="document('')/xsl:stylesheet/ns:root/ns:child">
                        <xsl:if test="@attr = 'y'">
                                <xsl:sequence select="@attr" />
                        </xsl:if>
                </xsl:for-each>
        </xsl:template>

</xsl:stylesheet>

....when invoked on itself produces :

bash-2.05b$ java net.sf.saxon.Transform seq.xsl seq.xsl 
Error at if on line 15 of file:/C:/cygwin/home/zaphod/code/seq.xsl:
  Cannot write an attribute when there is no open start tag
Transformation failed: Run-time errors were reported

    Can someone help me understand my error please? 

Thanks,
Kenneth


<Prev in Thread] Current Thread [Next in Thread>