Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java SAX parser. How to get raw XML code of the currently parsing event?

843834Jul 2 2008 — edited Jul 3 2008
Java SAX parser, please need a clue how to get the raw XML code of the currently parsing event... needed for logging, debugging purposes.

Here's and example, letting me clarify exactly what i need: (see the comments in source)
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {

	//..Here... or maybe somewhere elsewhere I need on my disposal the raw XML code of
	//..every XML tags received from the XML stream. I need simply to write it down
	//..in a log file, for debugging purposes, while parsing. Can anyone give me a suggestion
	//..how can i implement such logging while the SAX parser only returns me the tagname and
	//..attributes. While parsing I want to log the XML code for every tag in
	//..its 'pure form', like it is comming from the server directly on the
	//..socket's input reader.
	//...

	if ("p".equals(qName)) {
		etc...
	}
	
}
Than you in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 31 2008
Added on Jul 2 2008
6 comments
985 views