Attributes in XML file conflict problem? How to read them from DOM

G

Guest

When I define id attribute for both parent and child nodes, I get error of
conflict. For example, the following is invalid:
<parent id="1">
<child id="1">Name 1</child>
<child id="2">Name 2</child>
</parent>

Questions:
(1) If I do want to use id for both of them, how can I do?
(2) How can I read the attributes from DOM?

Thanks

David
 
B

bruce barker

xml requires that the id value must be unique (also they should not
start with a number), so your sample is invalid xml.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top