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 Jean-Louis Vila <jl...@cosmosbay.com> on 2000/06/07 14:46:34 UTC

XercesJ 1.1.1 - XMLSchema experience [2]

Sorry, here the right message,
Hi,

I just try to validate an xml with a schema but I couldn't
get valid results (both with xerces data samples and my own
xml/xsd files) !!

Here my results (files description after):
 SAXParser (validating of course) :
    - The structure is correctly validated ;
    - Types aren't verified 
         (ie, no errors occurs when letters are set in an unsignedShort)
 DOMParser (with feature/namespaces set to true)
    - No correct output !

So my questions are:
  What about validating types in SAXParser ?
  Why DOMParser don't works with XML-Schema ?

Any experience are welcome ...
Regards,
Jean-Louis Vila
My files are:
---- [begin :mini.xsd] ----
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/1999/XMLSchema" 
            xmlns="http://www.mySite.com/OOO" 
            targetNamespace="http://www.mySite.com/OOO">
<xsd:element name="theRoot">
<xsd:complexType>
	<xsd:element name="name" type="xsd:string" minOccurs="1"/>
	<xsd:element name="number" type="xsd:unsignedShort" minOccurs="1"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>
---- [end:mini.xsd] ----
---- [begin :mini.xml] ----
<?xml version="1.0" encoding="UTF-8"?>

<theRoot xmlns="http://www.mySite.com/OOO" 
          xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" 
          xsi:schemaLocation="http://www.mySite.com/OOO mini.xsd">
<name>Mon nom</name>
<number>123</number>
</theRoot>
---- [end:mini.xml] -----