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

key declarations (using a sequence constructor)

Subject: key declarations (using a sequence constructor)
From: Andy Chambers <achambers.home@xxxxxxxxxxxxxx>
Date: Tue, 6 Oct 2009 18:22:04 +0100
 key declarations (using a sequence constructor)
Hi,

I'm playing around with the added features available in key
declarations but I think I must be misunderstanding
something.  Here's my key declaration (I realize that this particular
example would be better as a simple
@use but I want to understand how it works to see if it might make
some of my other keys look a little
better)....

  <xsl:key name="keyNames"
		   match="name | mdv">
	<lookup oid="{@oid}"/>
  </xsl:key>

and an example input document is something like...

<timaeus-names xmlns:odm="http://www.cdisc.org/ns/odm/v1.3">
  <mdv oid="TEST/M/oids" name="TESTMOIDS">
    <name oid="S001" parent-oid="" name="S001" />
    <name oid="F001" parent-oid="S001" name="F001" />
    <name oid="IG001" parent-oid="F001" name="IG001" />
    <name oid="AA.AA" parent-oid="IG001" name="AAAA" />
    <name oid="AA..AA" parent-oid="IG001" name="AAAA2" />
    <name oid="AA...AA" parent-oid="IG001" name="AAAA3" />
  </mdv>
</timaeus-names>

I thought that to use this key to lookup the @name associated with
@oid="AA.AA" for example, I'd do

	<xsl:variable name="lookup">
	  <lookup oid="AA.AA"/>
	</xsl:variable>
        <xsl:sequence select="key('keyNames', $lookup)/@name"/>

But this actually returns a sequence containing all the @names.

I seek enlightenment as to why this is so :-)

--
Andy

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.