Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to read the attributes of XML file

843834Sep 5 2008 — edited Sep 11 2008
Hi this is ant,

I am new to java, XML, I have a senario

1) I have to read all the href attributes for topicref child, and then read the corresponding xml file which is mapped in href="".

First.xml

<map>
<topicref nav="garage" href="task/gar/view.xml" class="..">
<linktext class="_map/linktext">Garage</linktext>
<topicref nav="" href="task/gar/change.xml" ..>
<linktext class="_map/linktext">Garage</linktext>
</topicref>
</linktext>
</topicref>
</map>

2) task/gar/view.xml file , has id attribute & need to get the id values.

Like this I have to get the id values for all the href attributes of first xml & read correspoding id values.

I have just read some doc using XPATH we can do, please help me.

Thanks.
anto
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 9 2008
Added on Sep 5 2008
1 comment
175 views