#734 NPE in s9api DocumentBuilder

v9.0
closed
Michael Kay
s9api API (27)
5
2012-10-08
2007-11-13
Michael Kay
No

A NullPointerException occurs in the s9api DocumentBuilder if (a) the Source supplied to the build() method has no systemId set, and (b) the DocumentBuilder itself has no baseURI set.

Failing to set a base URI shouldn't cause problems unless you actually need to use the base URI of the document. A patch is being placed in Subversion.

Discussion

  • Ernst de Haan
    Ernst de Haan
    2007-11-23

    Logged In: YES
    user_id=11053
    Originator: NO

    Indeed, I think I triggered the same error in my project. I got:

    java.lang.NullPointerException
    at net.sf.saxon.s9api.DocumentBuilder.build(DocumentBuilder.java:282)
    at net.sf.saxon.s9api.XsltTransformer.setSource(XsltTransformer.java:106)

    with Saxon 9.0.0.1 on Java 1.5 on Max OS X 10.4.11.

    I will attempt building from SVN to see if that resolves the issue.

     
  • Ernst de Haan
    Ernst de Haan
    2007-11-23

    Logged In: YES
    user_id=11053
    Originator: NO

    Just recompiling the DocumentBuilder.java file (from r163) and sticking it in the saxon9-s9api.jar file resolves the issue for me. Thanks for fixing this!

     
  • Michael Kay
    Michael Kay
    2007-12-01

    Logged In: YES
    user_id=251681
    Originator: YES

    Fixed in 9.0.0.2