Question:
Sax parser?
freedom_seekar
2007-08-07 01:47:39 UTC
HI i need some information regarding the SAX parser,
while parsing an XML using SAX Parser is it mandatory that the tags in the XML to be in a Defined Order or can the tags be in any order.
in my case i have to parse an XML in which the tags won't be in a predefined order thay can come in any order but all the tags will be present.
Three answers:
jake cigarâ„¢ is retired
2007-08-07 11:39:06 UTC
Sax, vs Dom!



Sax sees one thing at a time.... if your code expects it in an order... it will have to be in that order!



Using SAX, you should program nondeterministically , dealing with the embedded tags AFTER you hit the . More like a hybrid SAX/DOM parser.



DOM is easier, but loading the entire XML into memory may crush a little machine.
Ronney
2007-08-07 01:57:06 UTC
If all TAGS are present then it should not cause any problems for the SAX parser.... the parser actually parses the complete XML file for the TAG, so its not important that they are present in any predefined order as such.
Dull Jon
2007-08-07 01:50:35 UTC
It should be fine... I see no reason why not.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...