• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

xml reading

 
bhuwan naigaonkar
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.)

Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic