[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Saxon: java.lang.NullPointerException from Builder.setPrevie
Using Saxon 5.4.1 Java API with Sun JDK 1.2.2 on RedHat Linux 6.0 (with updates) with default parser, etc. Trying to right a very simple "identity"Java utilty that reads an XML file and copies/writes the results on stdout (ie System.out). (code fragment)------------------------------------------- ... PreviewManager pm = new PreviewManager(); pm.setPreviewMode( "preview" ); pm.setPreviewElement( new Name( "ROW" ) ); Builder b = new Builder() b.setPreviewManager( pm ) DocumentInfo docinfo = b.build( new ExtendedInputSource( new File( filename ) ) ); .... (A) --------------------------------------------------- IF b.setPreviewManager( pm ) has been called and XML source file filename has no <DOCTYPE .... > or souce XML file has a <DOCTYPE ...> but the source is invalid for the referenced DTD THEN the call to b.build( .... ) above fails with nothing but a "java.lang.NullPointerException". (B)--------------------------------------------------- IF b.setPreviewManager( pm ) has NOT been called and XML source file filename has no <DOCTYPE .... > or souce XML file has a <DOCTYPE ...> but the source is invalid for the referenced DTD THEN the call to b.build( .... ) above succeeds BUT no output is produced [see post "no DTD, bad DTD generates no error, no output"] (C)--------------------------------------------------- IF b.setPreviewManager( pm ) has been called and XML source file has a <DOCTYPE...> and is valid for that DTD THEN the call to b.build(...) succeeds and output is produced. --------------------------------------------------- If a DTD is always required, then I think situation A should generate an error not a java.lang.NullPointerException. If a DTD is not required, then I think situation A should not fail and both situation A and B should produce output I am trying to find out if these are bugs or incorrect useage by someone new to Saxon. Thanks R.Parr Temporal Arts 330 S. Yellowstone Drive, Suite 3 Madison, WI 53705, U.S.A. 608.833.4578 RParr@xxxxxxxxxxxxxxxx XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|