This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]