[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Null Attributes Break xsl:key?


Subject: Null Attributes Break xsl:key?
From: Bill Entwistle <ent@xxxxxxxxx>
Date: Mon, 05 Jun 2000 12:15:15 -0500

Is a null attribute legal?  As in, for example:

	<some-element some-attribute=""/>

If so, then the following looks like a Xalan bug.  I would love
to find out otherwise, or be given a workaround for the problem.
I discovered that if you have a null attribute in your XML, then
the xsl:key instruction fails to create any keys after the
element with the null attribute.  For example, if I process the
following XML:

	<group>
		<person>
			<id code="1672"/>
			<bonus amount=""/>
		</person>
		<person>
			<id code="2035"/>
			<bonus amount=""/>
		</person>
	</group>

with the following script:

	<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		version="1.0">

	<xsl:key name="Codes" match="person" use="id/@code"/>

	<xsl:template match="/">
		<xsl:copy-of select="key('Codes','1672')"/>
		<xsl:copy-of select="key('Codes','2035')"/>
	</xsl:template>

	</xsl:stylesheet>

then it outputs the first node set, but fails to output the second.
If I stick anything into the null attribute fields, then the script
works as expected.

I tried to contact Apache about this, but they apparently don't allow
mere users to access their bug reporting site (even though they
advertise it widely) and they don't publish their phone number.

Thanks for any help,

Bill



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords
xml