Subject: Re: [xsl] IDREFS and key()|
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 28 Nov 2005 22:49:53 -0500
I have an element that contains an IDREFS attribute like the following:
<Attribute id="aAtt" references="foo bar"><Name>Att</Name></Attribute>
The references attribute is defined as an IDREFS and the schema and document that this lives in are all valid.
I want to use the references attribute in a key definition so I can reverse the relationship and in this case from the element identified as foo or bar, indicate that the Attribute element, named Att links to it.
My key definition is this:
<xsl:key name="attribute-references" match="Attribute" use="@references"/>
It seems like the key() is trying to match my value of 'foo' against the complete string of 'foo bar', rather than doing a "contains" sort of match.
Is this what is expected?
When I provide the full 'foo bar' to the for-each I now match this Attribute definition.
How do I get the key() function to break up the IDREFS
and process the individual values? I tried using id() in the key definition but that didn't help.
-- Upcoming XSLT/XSL-FO hands-on courses: Denver,CO March 13-17,2006 World-wide on-site corporate, govt. & user group XML/XSL training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal