[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Null Attributes Break xsl:key?

Subject: Null Attributes Break xsl:key?
From: Bill Entwistle <ent@xxxxxxxxx>
Date: Mon, 05 Jun 2000 18:40:44 -0500
xml null attribute
Are null attribute values legal in XML?  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 this 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 attribute fields to make them non-null,
then the script works as expected and outputs both node sets.

I tried to contact Apache about this, but they apparently don't allow
mere users to access their bug reporting website 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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.