From: SourceForge.net <no...@so...> - 2009-10-12 19:08:55
|
Bugs item #2876511, was opened at 2009-10-11 17:09 Message generated for change (Comment added) made by mercuron You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=373747&aid=2876511&group_id=21935 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: saxon extensions Group: None >Status: Closed >Resolution: Rejected Priority: 5 Private: No Submitted By: mercuron (mercuron) Assigned to: Nobody/Anonymous (nobody) Summary: NullPointerException in Saxon Extension Initial Comment: If a docbook document contains a "screenco"-element (I guess the same occurs with other parent of http://www.docbook.org/tdg/en/html/areaspec.html, such as graphicco, imageobjectco, programlistingco) with out an "areaspec"-child the docbook stylesheets fail with the following message: java -cp C:\apps\saxon6.5.5\saxon.jar;C:\apps\docbook-xsl-1.75.2\extensions\saxon65.jar com.icl.saxon.StyleSheet -o saxon-extension-bug-with-extension.html saxon-extension-bug.xml C:\apps\docbook-xsl-1.75.2\html\docbook.xsl use.extensions=1 Error at xsl:copy-of on line 37 of file:/C:/apps/docbook-xsl-1.75.2/html/callout.xsl: Exception in extension function java.lang.NullPointerException Transformation failed: Run-time errors were reported saxon-extension fails with a NullPointerException. Plesae note that the following command will be fine: java -cp C:\apps\saxon6.5.5\saxon.jar;C:\apps\docbook-xsl-1.75.2\extensions\saxon65.jar com.icl.saxon.StyleSheet -o saxon-extension-bug-without-extension.html saxon-extension-bug.xml C:\apps\docbook-xsl-1.75.2\html\docbook.xsl use.extensions=0 The actual error occurs in File com.nwalsh.saxon.CalloutEmitter.java:142 NodeList children = areaspec.getChildNodes(); "areaspec" is null because it has no children. ---------------------------------------------------------------------- >Comment By: mercuron (mercuron) Date: 2009-10-12 21:08 Message: ack. closing this issue (marked as rejected), but not deleting it to keep a reference for other users. thanks anyway. ---------------------------------------------------------------------- Comment By: Mauritz Jeanson (mzjn) Date: 2009-10-12 17:49 Message: I take your point, but I am reluctant to add a workaround for an error that occurs only if you break the schema rules. (However, it was wrong of me to state that a book *must* contain a chapter...) ---------------------------------------------------------------------- Comment By: mercuron (mercuron) Date: 2009-10-11 21:19 Message: True, that it is not valid against the DTD. Sorry, I should have noted that. I also checked that it does not appear if the document is valid. I mainly reported it as I thought it would help to stabilize code and because the error is pretty hard to spot. The NullPointerException is reported by Saxon, but the underlying Stacktrace of the saxon-extension is lost at that place. Btw. the error does not appear with the Xalan-extension. I'm happy to close this issue, if you think it's not worth looking further into it. I guess the fix would be a simple if-statement, but you may have a better overview of potential side effects. ---------------------------------------------------------------------- Comment By: Mauritz Jeanson (mzjn) Date: 2009-10-11 20:34 Message: Your sample document claims to be DocBook 4.5, but it is not valid against the DTD. You cannot have a screenco element without an areaspec child (and a book must have at least one chapter). Stylesheets and extensions work under the assumption that the input is valid. Bugs resulting from invalid input are not likely to be fixed. If you can reproduce the bug with a valid document, I'll look into it. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=373747&aid=2876511&group_id=21935 |