You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Ramesh Gupta <ra...@eNode.com> on 2000/12/07 14:57:08 UTC

Namespace problems in Xerces-J 1.2.3

I just tried to move from Xerces 1.2.1 to 1.2.3 and found that my documents
that validated fine before no longer do so.

Parsing a bare instance document [1] with a simple schema [2] produces the
following error in Xerces 1.2.3:
org.w3c.dom.DOMException: DOM003 Namespace error

If I remove the <import> element from the schema, the error goes away!

[1] Instance document
=====================
<?xml version="1.0" encoding="UTF-8"?>
<foo    xmlns="FooNamespace"
        xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
        xsi:schemaLocation="FooNamespace http://localhost/fooSchema.xsd">
</foo>

[2] Schema
==========
<?xml version="1.0" encoding="UTF-8"?>
<schema    xmlns="http://www.w3.org/1999/XMLSchema"
        targetNamespace="FooNamespace"
        xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
        xsi:schemaLocation="http://www.w3.org/1999/XMLSchema
http://www.w3.org/1999/XMLSchema.xsd">

    <import    namespace="http://www.w3.org/XML/1998/namespace"
            schemaLocation="http://www.w3.org/2000/04/xml.xsd"/>

    <element    name="foo">
        <complexContent/>
    </element>

</schema>


on 12/3/00 2:00 PM, Eric Ye at ericye@locus.apache.org wrote:

> Yes, the schema that uses <xsd:schema...> tags will not work with
> Xerces1.2.2, and believe it or not, it was due to a more compiant DOM Level
> 2 implementation, and we didn't have enough schema test cases to unveil this
> problem.
> 
> I already fixed this problem, you could either check out the latest source
> from CVS or wait for next release.



Re: Namespace problems in Xerces-J 1.2.3

Posted by Eric Ye <er...@locus.apache.org>.
Just confirmed with Arnaud, there is a small nit in the DOM implementation
after we applied the default attribute patch from Elena, he will fix that in
a jiffy. maybe he already did that.

Since this will only happen when a dtd has declared a "xmlns" attribute and
this dtd was used by a schema, I would see chances somebody will run into
this is very low, so Thanks to Ramesh, for help unveil this.
_____


Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org

----- Original Message -----
From: "Ramesh Gupta" <ra...@eNode.com>
To: <xe...@xml.apache.org>
Sent: Thursday, December 07, 2000 5:57 AM
Subject: Namespace problems in Xerces-J 1.2.3


> I just tried to move from Xerces 1.2.1 to 1.2.3 and found that my
documents
> that validated fine before no longer do so.
>
> Parsing a bare instance document [1] with a simple schema [2] produces the
> following error in Xerces 1.2.3:
> org.w3c.dom.DOMException: DOM003 Namespace error
>
> If I remove the <import> element from the schema, the error goes away!
>
> [1] Instance document
> =====================
> <?xml version="1.0" encoding="UTF-8"?>
> <foo    xmlns="FooNamespace"
>         xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
>         xsi:schemaLocation="FooNamespace http://localhost/fooSchema.xsd">
> </foo>
>
> [2] Schema
> ==========
> <?xml version="1.0" encoding="UTF-8"?>
> <schema    xmlns="http://www.w3.org/1999/XMLSchema"
>         targetNamespace="FooNamespace"
>         xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
>         xsi:schemaLocation="http://www.w3.org/1999/XMLSchema
> http://www.w3.org/1999/XMLSchema.xsd">
>
>     <import    namespace="http://www.w3.org/XML/1998/namespace"
>             schemaLocation="http://www.w3.org/2000/04/xml.xsd"/>
>
>     <element    name="foo">
>         <complexContent/>
>     </element>
>
> </schema>
>
>
> on 12/3/00 2:00 PM, Eric Ye at ericye@locus.apache.org wrote:
>
> > Yes, the schema that uses <xsd:schema...> tags will not work with
> > Xerces1.2.2, and believe it or not, it was due to a more compiant DOM
Level
> > 2 implementation, and we didn't have enough schema test cases to unveil
this
> > problem.
> >
> > I already fixed this problem, you could either check out the latest
source
> > from CVS or wait for next release.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
>