• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SAX Parser

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I had a few doubts in XML parsing. It would be great if you could help me out.
1) Can a SAX Parser modify the XML data as in remove elements, make substitutions in the text...or should I use a DOM object.
2) I wanted to read a DTD to read the list of entities defined in it. How could I do that.... I dont want the DTD to validate my XML I just want to read it.

Thanks a lot,
Ali
 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I haven't been playing with XML for too long but:

1: Yes, you can alter the stream as you read it and then pass it on somewhere else. However, if you wish to navigate your XML in any way other than forward then you would be better off moving to DOM.

2: Don't really understand what you mean - the DTD is just XML and can be read with the same parser.

I can recommend the J2EE Tutorial chapter on SAX if you want to work through these concepts.

Regards,

Kenny
 
reply
    Bookmark Topic Watch Topic
  • New Topic