Re: [xml] Validating Schemata



On Thu, Nov 11, 2004 at 04:14:17PM +0000, Frans Englich wrote:
On Thursday 11 November 2004 15:49, Daniel Veillard wrote:
On Thu, Nov 11, 2004 at 02:10:50PM +0000, Frans Englich wrote:
Hello,

I want to validate my Schemata sometimes, simply to ensure no silly
mistakes have been made. I don't want to validate a document instance,
but simply tell xmllint to barf if my Schema isn't a Schema. Is this
possible?

  if the schemas doesn't compile, it will tell you.

Right, if I validate a document with the Schema. But if I don't want to 
validate a document, but only validate the Schema? Like this? :

xmllint --noout --schema file.xsd

(Note the absence of a xml document)

No, it doesn't work, but it gets my point through.

  well you can use testSchemas for that:

paphio:~/XML -> ./testSchemas tst.xml
tst.xml:0: Schemas parser error : The file "tst.xml" is not a XML schema.
paphio:~/XML ->

for xmllint you get the error but also the usage message...

paphio:~/XML -> xmllint --schema file.xsd
warning: failed to load external entity "file.xsd"
Schemas parser error : xmlSchemaParse: could not load 'file.xsd'.
WXS schema file.xsd failed to compile
Usage : xmllint [options] XMLfiles ...
....

  what you ask can probably be added easilly, an RFE in bugzilla will
help avoiding to loose track.

  Which version of the Schema ?

This one:
http://www.w3.org/2001/XMLSchema.xsd

  2001 ... hum, I'm pretty sure they published erratas since

With the output:

bash-2.05b$ xmllint --schema /tmp/XMLSchema.xsd Severities.xsd --noout
Unimplemented block at xmlschemas.c:5586

        while ((IS_SCHEMA(child, "unique")) ||
            (IS_SCHEMA(child, "key")) || (IS_SCHEMA(child, "keyref"))) {
            TODO child = child->next;
        }

  Identity constraints ! Not implemented yet

Unimplemented block at xmlschemas.c:5586
Unimplemented block at xmlschemas.c:5586
Unimplemented block at xmlschemas.c:5586
Unimplemented block at xmlschemas.c:5586
Unimplemented block at xmlschemas.c:5586
Unimplemented block at xmlschemas.c:5586
/tmp/XMLSchema.xsd:761: element element: Schemas parser error : Element 
'element': A global element declaration with the name 'element' does already 
exist.
/tmp/XMLSchema.xsd:974: element element: Schemas parser error : Element 
'element': A global element declaration with the name 'group' does already 
exist.
WXS schema /tmp/XMLSchema.xsd failed to compile
bash-2.05b$                                         

I'm upgrading to 2.6.16.

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]