Hi Brain ,

Which version of xerces are using please try using the latest version and let us know if you are still facing the problem
-venu



Brian Atkins wrote:

Help me understand what I am doing wrong.  Here's a small example
of two document which, as far as I can tell, conform to the
given schema.  One (good.xml) uses a default namespace (no prefix), while
the other (bad.xml) uses an explicit namespace (prefix='ex').

example.xsd
===========
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace='http://www.someone.com/example'
           xmlns='http://www.someone.com/example'
           xmlns:xsd='http://www.w3.org/2001/XMLSchema'
           xmlns:xsi='http://www.w3.org/2001/XMLSchema-Instance'
           xml:lang="en">

  <xsd:element name="Root">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="AnElement" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>

good.xml - target namespace with prefix 'ex'
============================================
<?xml version="1.0" encoding="UTF-8"?>
<ex:Root xmlns:ex="http://www.someone.com/example";
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
      xsi:schemaLocation="http://www.someone.com/example example.xsd">
  <AnElement/>
</ex:Root>

bad.xml - target namespace as default namespace
===============================================
<?xml version="1.0" encoding="UTF-8"?>
<Root xmlns="http://www.someone.com/example";
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
      xsi:schemaLocation="http://www.someone.com/example example.xsd">
  <AnElement/>
</Root>

Running both document and schema using SAX with schema and validation
turned on, I get no errors on "good.xml", but get the following on
"bad.xml":

cvc-complex-type.2.4.a: Invalid content starting with element 'AnElement'.
One of '{"":AnElement}' is expected.


Any help would be most welcome.

Thanks
Brian Atkins




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



Reply via email to