File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes xml reading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "xml reading" Watch "xml reading" New topic

xml reading

bhuwan naigaonkar

Joined: Nov 28, 2008
Posts: 1
hello friends,

one of our client requirement is, to read XML file dynamically and insert into tables, without using tag name (that is getElementByTagName() method) how i will get the tag name and its value in java.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
without using tag name (that is getElementByTagName() method)

Do you mean that you don't know the tag name or what?

Are you reading the XML document into a DOM? If so you could probably use XPath statements to extract the text. See the standard Java library javax.xml.xpath package (since Java 1.5).

(This really sounds like a homework assignment to me now that I think about it.)

I agree. Here's the link:
subject: xml reading
It's not a secret anymore!