Hi Urs,

Urs Reupke wrote:

thanks to the second error I just reported,
I could pinpoint the source of the problem and, hopefully,
create fix.

   Thanks for taking the time to track this all down.

The problem resulted from dom4j.Attribute returning the empty string as namespace URI if none is set, where as Batik expects a value of 'null' in such a case. Unfortunately, it appears to me that the dom4j version is correct in this case.

   If you read the DOM level 2 Core spec it says
(3rd para of 1.1.8 [1]):

        Note that because the DOM does no lexical checking, the empty
        string will be treated as a real namespace URI in DOM Level 2
        methods. Applications must use the value null as the
        namespaceURI parameter for methods if they wish to have no
        namespace.

   Thus I believe Batik's behavior is the correct one.  What you
state seems to be the case for XML Namespaces [2]:

        If the URI reference in a default namespace declaration is
        empty, then unprefixed elements in the scope of the declaration
        are not considered to be in any namespace.

Then later:

        The default namespace can be set to the empty string. This has
        the same effect, within the scope of the declaration, of there
        being no default namespace.

This solution works for me, but please let me know if there is any problem with it (or if the assumption above is wrong) so I can patch dom4j instead.

  I think that dom4j is wrong to use the empty string for no namespace.
What do you think?

---

[1]
http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#Namespaces-Considerations
[2]
http://www.w3.org/TR/1999/REC-xml-names-19990114/#defaulting

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to