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

Re: id/idref

Subject: Re: id/idref
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Sat, 15 May 1999 14:18:53 -0400
id idref
At 99/05/12 09:48 +0200, Bovone Stefano wrote:
>Is it wrong if I write:
><xsl:apply-templates select="id(@value)"/>
>I should write idref(@value).
>Is this correct?

Interestingly, this question came up from the students Monday during the
XSLT training course when examining one of the examples.

In your particular example, both are acceptable, because id() will convert
the argument (whatever type the argument is) to a string value before
looking for the element with the unique identifier.  The string value of a
node list is the generated value of the first item in the node list, which
is the value of the attribute, which works as you would expect.

For idref(), the argument is always a node set and the union of values of
all members is converted to set of unique identifiers and the value
returned is the set of corresponding element nodes.

For a simple attribute argument as you have, they work pretty much

Where the difference would be is if the attribute value has whitespace ...
the idref() would separate the value into separate identifiers for finding
elements, where the id() wouldn't.

I hope this helps.

.......... Ken

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  (Fax:-0995)
Website: XSL/XML/DSSSL/SGML services outline,  XSL/DSSSL shareware,
         stylesheet resource library, conference training schedule,
         commercial stylesheet training materials, on-line XSL CBT.

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

Current Thread


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.
First Name
Last Name
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.