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

Re: ID()

Subject: Re: ID()
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Wed, 31 Jul 2002 19:49:11 +0200
Re:  ID()
Hi Mark,

at first the function name is "id()" (lower case). It searches the whole tree. But there must exist a DTD for this tree, which declares the attribute ID as ID (http://www.xmlfiles.com/dtd/dtd_attributes.asp).

If you don't want to have a DTD, you can set up a key

<xsl:key name="nodes" match="node" use="@ID"/>

as top-level.

And later in a template

<xsl:apply-templates select="key('nodes', 'abc')"/>

which applies templates to all <node>'s with a value of ID attribute of 'abc'.

Regards,

Joerg

Mark Micallef wrote:
Hi,

  I have a tree with interspersed <task> tags and each task has an ID
attribute.  The tasks are not found under 1 particular not and I cannot
determine exactly where they are.  Can I use the ID() function to search
through the whole tree for a particular node or does it only search the
immediate subnodes?

Regards,

Mark


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.