Fwd: [cp-patches] More useful command-line options for XML parsers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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  <dog@xxxxxxx>
>
>     * 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




-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 188 bytes
Desc: This is a digitally signed message part
Url : http://developer.classpath.org/pipermail/classpath/attachments/20060607/c881d4b1/PGP.pgp

[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux