I thought this might be of general interest to Classpath users:

Begin forwarded message:
I committed this patch to add options to the command-line versions of the SAX and StAX XML parsers that allow you to set several configuration parameters, as well as syntax help on these options. It is primarily for debugging. There is also a minor tweak in reporting errors in the transformer.

2006-06-07  Chris Burdess  <[EMAIL PROTECTED]>

    * gnu/xml/stream/SAXParser.java,
gnu/xml/stream/XMLParser.java: Add command line options for setting
      parsing parameters (for simpler debugging).
* gnu/xml/transform/TransformerImpl.java: Try to ensure that I/ O error
      closing output stream is propagated to application.

I know that a few people have been having problems debugging XML usage in their applications, so if you didn't know already you can invoke both the SAX and the StAX parser from the command line with e.g.

jamvm gnu.xml.stream.SAXParser -v -n -c org.me.MyContentHandler .../file-to-test.xml

This allows you to test Classpath's parsing of individual XML files, optionally using your own SAX callback handlers.

I discussed some issues of trying to debug XML parsing embedded in 3rd party applications (where you typically don't have access to the XML input the application tries to parse) with twisti on IRC. I suggested that using a tee input stream or reader in those circumstances would be a good idea, to tee the XML input being received into a file (or perhaps directory of files?). If other people think this would be useful, we could perhaps include a TeeInputStream and TeeReader (and possible output streams and writers) in Classpath that could be installed via a system property or some other such mechanism. I'd appreciate any thoughts on this.
--
犬 Chris Burdess
  "They that can give up essential liberty to obtain a little safety
  deserve neither liberty nor safety." - Benjamin Franklin




Attachment: PGP.sig
Description: This is a digitally signed message part

Reply via email to