You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Don Grodecki <do...@browsersoft.com> on 2006/06/28 17:02:43 UTC

XMLDBTransformer blows up Saxon

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 "". - Don

                // 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); 



Re: XMLDBTransformer blows up Saxon

Posted by Don Grodecki <do...@browsersoft.com>.
1-What said the xml specification about null?
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:

2-Which saxon version blows up with null?
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.

- Don

----- Original Message ----- 
From: "Antonio Gallardo" <ag...@agssa.net>
To: <de...@cocoon.apache.org>
Sent: Wednesday, June 28, 2006 7:08 PM
Subject: Re: XMLDBTransformer blows up Saxon


Don Grodecki escribió:
> 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 "". - Don
>
>                 // 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);
>
>
Hi Don,

Thanks for the patch, would you responds this questions:

1-What said the xml specificationa about null?
2-Wich saxon version blows up with null?

Best Regards,

Antonio Gallardo.




Re: XMLDBTransformer blows up Saxon

Posted by Antonio Gallardo <ag...@agssa.net>.
Don Grodecki escribió:
> 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 "". - Don
>
>                 // 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); 
>
>   
Hi Don,

Thanks for the patch, would you responds this questions:

1-What said the xml specificationa about null?
2-Wich saxon version blows up with null?

Best Regards,

Antonio Gallardo.