Hi.

I  have  accidently  stumbled  upon  an  interesting  issue.  I have an XML
document with an element named "relation", which contains attributes "src"
and "dst". The result of an XPath query returns this XML from Xindice:

<?xml version="1.0"?>
<xapi:resourceSet xapi:collectionURI="xmldb:xindice:///db/relations"
                  xmlns:xapi="http://www.xmldb.org/xapi/ResourceSet";>
        <xapi:resource xapi:documentID="7595167c">
                <relation rel_id="1"
                        src="IOR%3A00..."
                        dst="IOR%3A00..." 
                        xmlns:src="http://xml.apache.org/xindice/Query";
                        src:col="/db/ophelia/tm/relations"
                        src:key="7595167c" />
        </xapi:resource>
</xapi:resourceSet>

It  seems  like  it's  a  valid XML, at least assuming the namespace may be
declared as an attribute inside the same element where it's used.

Well, Xerces won't parse it. Neither 1.4.4, nor 2.0.1. The exception says:

(2.0.1)
Attribute "src" bound to namespace "null" was already
specified for element "relation".

(1.4.4)
Attribute "xmlns:src"
was already specified for element "relation".

As  you can see in both cases the explanation of the exception, at least to
me, doesn't really explain anything...

Do  you  think  it's Xerces's bug, or maybe I don't understand something...
M$ parses says this XML is a valid one.

Cheers,
Dawid

Reply via email to