Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

need help urgently  RSS feed

 
Rishi Yagnik
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends
if my XMLDocument is containing a DOM Structure can i parsed that document with SAXParser?
Rishi
 
Junilu Lacar
Sheriff
Posts: 11139
160
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aren't DOM and SAX just different ways of handling an XML document? You can use one or the other depending on how you want to use the XML data but the data structure is pretty much independent of the method of reading it.
I think the short answer would be "Yes." However, there are certain situations where one is more appropriate than the other. DOM is memory intensive but highly flexible. SAX sacrifices some of the flexibility in favor of efficiency.
I'm no expert in XML though, so please correct me if I'm wrong.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!