[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Saxon: java.lang.NullPointerException from Builder.setPrevie

Subject: Saxon: java.lang.NullPointerException from Builder.setPreviewManager(...)
From: "Randall J. Parr" <RParr@xxxxxxxxxxxxxxxx>
Date: Wed, 23 Aug 2000 09:06:58 -0500
java.lang.nullpointerexception
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.