W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2000

Trying to validate a sample xml file against a schema I am develo ping.

From: Michael Burns <Michael.Burns@sas.com>
Date: Mon, 9 Oct 2000 18:19:36 -0400
Message-ID: <DB8AFFD38A30D311BA6D0090276DC8C02D595E@merc09.us.sas.com>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
I am new to this list, but spent quite a bit of time reading and trying things
out today, so hopefully this is not a newby or RTFM question:
 
Question:
What is the best tool to use to validate an xml file and schema pair?
I have tried the xerces DOM parser, XML Instance from TIBCO (Extensiblity),
the xmlnorm program that is part of ltxml and the web based XSV.
None of them seems to match the primer examples very well. 
 
Background:
 
I am developing a tool to build a schema according to the latest draft
standard: http://www.w3.org/TR/2000/WD-xmlschema-0-20000922/ <http://www.w3.org/TR/2000/WD-xmlschema-0-20000922/> 
 
I have made quite a bit of progress using the xerces parser with it's validation
turned on.  It is now complaining about something in my schema (which I am
not free to share with you, Sorry).  So, I started cutting and pasting samples
from the primer to see if it complained about the examples from the primer too.
Sure enough it does.   So, I was pursuing other validation tools.  I downloaded
the ltxml-1.2 tools that were recently posted.  Got those built ok. :-) 
Then I tried xmlnorm -sxV on the problematic xml file but it said:
 
Warning: Document has no DTD, validating abandoned.
 
I will pursue looking into the sources for the xmlnorm and see if there are some
parser options I have to turn on to enable schema based validation.
Any clues??
 
In the mean time I tried out your web based validator (I guess this is what
people are calling XSV on the list): http://www.w3.org/2000/09/webdata/xsv <http://www.w3.org/2000/09/webdata/xsv> 
 
It says: 

Schema validating with XSV 1.166/1.77 of 2000/09/28 15:54:50


*	Target: file:/export/home/ht/xsvlog/@15848.4uploaded 
   (Real name: C:\ModelCompilerTestPen\doc\MOresult.xml) 

*	docElt: {None}objects 

*	No declaration for document root found, validation was lax 

*	schemaLocs: 

*	The schema(s) used for schema-validation had no errors 

*	instanceAssessed: true 

*	No schema-validity problems were found in the target 

Which initially led me to believe that my schema was really OK.
However, when I intentionally screwed up the schema It did not complain
at all.   When I changed an element tag in my xml file so that it was not
found in the schema, it still did not complain.  
 
I tried some other samples of valid xml and xsd such as the one that
comes as a sample with xerces.   personal-schema.xml and personal.xsd
I changed an element tag 'person' to 'persona' and now the xerces parser
complains:
[Error] personal-schema.xml:5:27: Element type "persona" must be declared.
[Error] personal-schema.xml:5:27: Attribute "id" must be declared for element type "persona".
[Error] personal-schema.xml:41:14: The content of element type "personnel" must match "(##any:uri=)+".
[Error] personal-schema.xml:41:14: An element with the identifier "Big.Boss" must appear in the document.
personal-schema.xml: 2423 ms (37 elems, 19 attrs, 122 spaces, 146 chars)
 
But XSV does not complain at all:

Schema validating with XSV 1.166/1.77 of 2000/09/28 15:54:50


*	Target: file:/export/home/ht/xsvlog/@15856.4uploaded 
   (Real name: C:\sasmkb\xml\parsers\xerces-1_2_0\data\personal-schema.xml) 

*	docElt: {None}personnel 

*	No declaration for document root found, validation was lax 

*	schemaLocs: 

*	The schema(s) used for schema-validation had no errors 

*	instanceAssessed: true 

*	No schema-validity problems were found in the target 

  _____  

 
 
--------------------------------------------------------------------------------------------
Michael Burns                             email: Michael.Burns@sas.com
Principal Systems Developer        home: mburns@bga.com 
Metadata Integration Technology   voice: (512)258-5171x3264
SAS Institute, Inc.                           fax: (512)258-3906
11920 Wilson Parke Ave.        www: http://www.realtime.net/~mburns
Austin, TX 78726-4052            sww: http://sww.sas.com/~sasmkb
   "choose for yourselves today whom you will serve;...
    but as for me and my house, we will serve the Lord." Joshua 24:15


 
Received on Monday, 9 October 2000 18:20:09 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:47 UTC