Dear All, I am trying to parse a XML file without using SAX or DOM. I would like to develop a simple parser. If you provide me some tutorials about this it will be very useful. The main thing is the XML file should be parsed by Java Application Program.
Thinking out loud here, parsing XML file without SAX and DOM -
To me this means, read the XML file as a text file and manipulate what various characters mean. Say if you encounter a '<' symbol, possible indication of a start or end element. If the '<' char is immediately followed by a '/' char, it indicates a end element.
Unfortunately I don't have any links handy to that detail, but any text parsing java code could be used as a tutorial. I would love to see other thoughts on this. Thanks.
Remember that XML has requirements for nesting elements to make "well formed" XML so parsing will resemble processing algebraic notation. Since XML parsers have been part of the standard Java release since Java 1.4 , any Application Program can parse XML. A number of open source simple XML parsers have been developed - for example the kXML project. You might find inspiration there. Bill
Originally posted by Raghuraman Muthuswamy: if you provide me with some text parsing tutorials it will be very helpful.
I remember William Brogden mentioned about using StringTokenzier or some related API for a question related to reading a csv like text file. Cant get that particular post. I guess u r interested in developing ur own parser, i would suggest you to looking into the source of kXML,Xerces, Crimson and see how they have done it ?? Cheers Balaji