Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.9
-
None
-
Patch available
Description
The XMLDBTransformer blows up Saxon, which does not like null URIs. The
following fix seems to work, replacing null in the first parameter to
addAttribute with "".
// Report result
AttributesImpl attrs = new AttributesImpl();
attrs.addAttribute("", XMLDB_QUERY_OID_ATTRIBUTE,
XMLDB_QUERY_OID_ATTRIBUTE, "CDATA", this.key);
attrs.addAttribute("", XMLDB_QUERY_TYPE_ATTRIBUTE,
XMLDB_QUERY_TYPE_ATTRIBUTE, "CDATA", this.operation);
attrs.addAttribute("", XMLDB_QUERY_RESULT_ATTRIBUTE,
XMLDB_QUERY_RESULT_ATTRIBUTE, "CDATA", result);
The API being called is the SAX org.xml.sax.ContentHandler.createElement().
From the Interface definition at http://www.saxproject.org/apidoc/index.html:
"Parameters:
uri - the Namespace URI, or the empty string if the element has no Namespace
URI or if Namespace processing is not being performed
..."
Note that a null value is not specified as one of the options:
Both the versions that I have, which are saxon8 (jar contents dated
4/7/2005) and saxonB-8.7.3 (the latest), blow out with a
NullPointerException.
I have used Saxon quite a bit, for XSLT 2.0, and the only calls to Saxon
with null URIs have been from the XMLDBTransformer.
following fix seems to work, replacing null in the first parameter to
addAttribute with "".
// Report result
AttributesImpl attrs = new AttributesImpl();
attrs.addAttribute("", XMLDB_QUERY_OID_ATTRIBUTE,
XMLDB_QUERY_OID_ATTRIBUTE, "CDATA", this.key);
attrs.addAttribute("", XMLDB_QUERY_TYPE_ATTRIBUTE,
XMLDB_QUERY_TYPE_ATTRIBUTE, "CDATA", this.operation);
attrs.addAttribute("", XMLDB_QUERY_RESULT_ATTRIBUTE,
XMLDB_QUERY_RESULT_ATTRIBUTE, "CDATA", result);
The API being called is the SAX org.xml.sax.ContentHandler.createElement().
From the Interface definition at http://www.saxproject.org/apidoc/index.html:
"Parameters:
uri - the Namespace URI, or the empty string if the element has no Namespace
URI or if Namespace processing is not being performed
..."
Note that a null value is not specified as one of the options:
Both the versions that I have, which are saxon8 (jar contents dated
4/7/2005) and saxonB-8.7.3 (the latest), blow out with a
NullPointerException.
I have used Saxon quite a bit, for XSLT 2.0, and the only calls to Saxon
with null URIs have been from the XMLDBTransformer.