Re: XML-Schema Validator Problems

Billy wrote: (BTW, is there any recommended XML-Schema validator other than
XMLSpy4's???)

Dear Billy,

     There are numerous XML-Schema validators available.  TIBCO
Extensibility sells one. The Apache Software Foundation offers the
open-source Xerces-J 1.4.3 (see http://xml.apache.org) and is working on a
schema validator for Xerces-C also.  XSV, built by the University of
Edinburgh in conjunction with the W3C, is available -- see
http://www.w3.org/XML/Schemas for more info.  There is a schema validator
in a beta version of MSXML4 from Microsoft.  There is a schema checking
tool written by IBM Watson Research on alphaworks
(http://www.alphaworks.ibm.com/tech/xmlsqc).  [I am one of the authors of
this tool].  I believe that Oracle also has a validator, though I think it
is incomplete or down level.  This brief list is almost certainly
incomplete.

     Different validators and tools have different strengths and
weaknesses.  In the absense of a conformance suite, it is hard to tell
right now which validator is closest to implementing everything it
implements exactly according to the W3C XML Schema specs, and which
validator or tool implements everything (100%) in those specs.  Further,
there are small ambiguities and errors in the specs, so tool and validator
writters will probably change their code when the W3C issues an "Errata"
document on the W3C XML Schema specs.

     If interoperability is important to you, I recommend that you check
your schema with multiple validators or multiple tools.

     If you would like to donate your schemas to become part of some
conformance suite, look for info on the W3C XML Schema page, or contact me
directly.

          Good luck,
          Bob

Bob Schloss
IBM Watson Research
Yorktown Heights, New York, USA
http://www.research.ibm.com/XML




"Billy Chan" <billy@hkust.net>@w3.org on 09/20/2001 10:24:54 PM

Sent by:  xmlschema-dev-request@w3.org


To:   xmlschema-dev@w3.org
cc:
Subject:  XML-Schema Validator Problems



Hi,

I've tried using XMLSpy4 to validate a XML with the Schema I wrote for the
XML. I just couldn't get my expected result. I think my schema should be
correctly implemented and I wonder if it is because of XMLSpy4's
validator's incorrect examination of my codes.

Here's part of my schema in concern:
<xs:element name="VALUE">
  <xs:complexType>
    <xs:attribute name="value-attr" type="attrType" use="required"/>
  </xs:complexType>
</xs:element>

<xs:simpleType name="attrType">
  <xs:union>
    <xs:simpleType>
      <xs:restriction base="xs:string">            <xs:enumeration value
="N/A"/>            <xs:enumeration value=""/>
      </xs:restriction>
    </xs:simpleType>
    <xs:simpleType>
     <xs:restriction base="xs:double"/>
    </xs:simpleType>
   </xs:union>
</xs:simpleType>

The VALUE element is designed to have double values or "N/A" or emtpy
string values.

And the elements are declared as follows in my XML:
1. <VALUE abc=""/>
2. <VALUE attrType="N/A"/>
3. <VALUE attrType="abc"/>
4. <VALUE/>

For case 1, 2 and 3, the validator says my XML is valid (but case 1 and 3
should not be valid, according to the schema). The validator only detects
the error for case 4.

I am looking for help to clarify if it's my schema's syntax problem or if
it's the incorrect implementation of the XMLSpy4 validator. Please help and
suggest. (BTW, is there any recommended XML-Schema validator other than
XMLSpy4's???)

Thank you very much.

regards,
Billy
--
_______________________________________________
Get your free email from http://hkust.net
Powered by Instant Portal

Received on Friday, 21 September 2001 13:01:47 UTC