• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

how to create DOM structure from SAX parser

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
Could you please tell me in detail that how to create DOM structure from SAX parser.

Like:
For a given XML file, a SAX parser is started parsing and that time retrieving the tag and their corresponsing value we have to create a DOM object or DOM object structure.

So in the time of SAX parsing and creating DOM structure How would we know who is the parent and who is the child for DOM object.

Regards,
Biswajit Paria
 
Biswajit Paria
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could anyone please look into it?

Regards,
Biswajit Paria
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, DOM parsers alway use a SAX parser as input and constuct the DOM as the various SAX events arrive. Take a look at the Java source code to learn how it is done.

I don't understand what your problem "who is the parent" etc is. A DOM has a Document node containing all of the DOM data. Your first step should be to thoroughly understand the contents of the org.w3c.dom package - there is a great table in the javadocs for the Node interface that will help you understand the contents of a DOM.

Bill
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic