You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by MAHE Vincent FTRD/DIH/REN <vi...@rd.francetelecom.fr> on 2001/04/03 16:07:56 UTC

question about getting nodes with unique ids

I have an XML tree and each node in this tree has a unique id.

What is the best way to get a single node with a given id with XSL
instructions ?

I've seen a lot of solutions which need a DTD and use the id() function but
what if I don't want any DTD in my XML document ?

I've tried the <xsl:id ...> instruction and it doesn't seem to work with
Xalan J2.

Thanks.

Vincent 

Re: question about getting nodes with unique ids

Posted by "Chris P. McCabe" <ch...@choicehotels.com>.
Take a look at the xsl:key element and the key() function.  It is more
flexible than id().

-Chris

MAHE Vincent FTRD/DIH/REN wrote:

> I have an XML tree and each node in this tree has a unique id.
>
> What is the best way to get a single node with a given id with XSL
> instructions ?
>
> I've seen a lot of solutions which need a DTD and use the id() function but
> what if I don't want any DTD in my XML document ?
>
> I've tried the <xsl:id ...> instruction and it doesn't seem to work with
> Xalan J2.
>
> Thanks.
>
> Vincent