Win a copy of Head First Android this week in the Android forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic