[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [xml-dev] unique attribute id - to use method getElementById() onDocument
- From: Eric Bohlman <email@example.com>
- To: "'firstname.lastname@example.org'" <email@example.com>
- Date: Thu, 27 Sep 2001 11:58:54 -0500
9/27/01 8:10:04 AM, "SUS S. Sunkannavar" <firstname.lastname@example.org> wrote:
>I want to use the method getElementById( String elementId) on Document
>How can I specify that a particular attibute of an element is an unique ID
>to a DOM parser?
You need to include a DTD (or DTD subset) that declares the attribute to be of type ID.
> < Book isbn="1234">
>Here for Book element I want to specify isbn as an unique attribute.
>I want to retrieve Book elements using getElementById(...) method.
Attributes declared as ID have to have values that match the Name production in the XML
Recommendation, which among other things means they can't begin with a digit.