W3C home > Mailing lists > Public > public-xml-id@w3.org > September 2004

[closed] XML - id lookup

From: Norman Walsh <Norman.Walsh@Sun.COM>
Date: Fri, 24 Sep 2004 08:09:51 -0400
To: public-xml-id@w3.org
CC: Marek Mazurek <mazurek@easynet.ro>
Message-ID: <87fz5727hs.fsf@nwalsh.com>
| If I have an "ID" of a node of the input document that I am translating. How
| can I efficiently lookup the node in the input document and 
| get all its details ( attributes & elements ).

That really depends on the processing language that you're using. In
XSLT, you can use the id() function or a key(), if you know the names
of all the ID attributes.

In the DOM, you can use getElementByID().

Other technologies no doubt offer other methods. The purpose of the xml:id
specification is to make it easy for those technologies to recognize ID-type
attributes even when there's no supporting DTD or schema.

                                        Be seeing you,
                                          norm

-- 
Norman.Walsh@Sun.COM / XML Standards Architect / Sun Microsystems, Inc.
NOTICE: This email message is for the sole use of the intended
recipient(s) and may contain confidential and privileged information.
Any unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.

Received on Friday, 24 September 2004 12:10:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:21:38 GMT