Re: [xsl] ID()

Subject: Re: [xsl] ID()
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Wed, 31 Jul 2002 19:49:11 +0200
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