"Arndt Jonasson" <ar************@gmail.com> wrote in
news:11*********************@f6g2000cwb.googlegrou ps.com:
Stan R. wrote: 2) Just one more question I can't really find any info on. Is there
a way (hopefuly with xmllint) to do a quick check for any errors in
a DTD or XSD file, to make sure I didn't mistype something or
otherwise syntatical blunder?
I don't know about checking a DTD, but you can check a schema file
like this:
xmllint --noout -schema http://www.w3.org/2001/XMLSchema.xsd
myschema.xsd
Thank you, but that doesn't seem to work as expected. While my xsd works
without error against my test xml document, testing the xsd in the manner
you desribe yields a lot of errors in the
http://www.w3.org/2001/XMLSchema.xsd file:
$ xmllint --noout --schema test.xsd test.xml
test.xml validates
$ xmllint --noout --schema
http://www.w3.org/2001/XMLSchema.xsd test.xsd
Unimplemented block at xmlschemas.c:1934
Unimplemented block at xmlschemas.c:1934
Unimplemented block at xmlschemas.c:1934
Unimplemented block at xmlschemas.c:1934
Unimplemented block at xmlschemas.c:1934
Unimplemented block at xmlschemas.c:1934
Unimplemented block at xmlschemas.c:1934
compilation error: file
http://www.w3.org/2001/XMLSchema.xsd line 234
element xs:element
Content model of schema is not determinist:
Unimplemented block at xmlschemas.c:3246
Unimplemented block at xmlschemas.c:3246
compilation error: file
http://www.w3.org/2001/XMLSchema.xsd line 308
element xs:enumeration
Schemas: type restriction 46 enumeration value unbounded invalid
compilation error: file
http://www.w3.org/2001/XMLSchema.xsd line 2148
element xs:maxInclusive
Schemas: type restriction 372 facet value 65535 invalid
compilation error: file
http://www.w3.org/2001/XMLSchema.xsd line 2089
element xs:minInclusive
Schemas: type restriction 367 facet value -32768 invalid
compilation error: file
http://www.w3.org/2001/XMLSchema.xsd line 2090
element xs:maxInclusive
Schemas: type restriction 367 facet value 32767 invalid
compilation error: file
http://www.w3.org/2001/XMLSchema.xsd line 2126
element xs:maxInclusive
Schemas: type restriction 370 facet value 18446744073709551615 invalid
compilation error: file
http://www.w3.org/2001/XMLSchema.xsd line 630
element xs:enumeration
Schemas: type restriction 142 enumeration value #all invalid
compilation error: file
http://www.w3.org/2001/XMLSchema.xsd line 895
element xs:enumeration
Schemas: type restriction 230 enumeration value 0 invalid
compilation error: file
http://www.w3.org/2001/XMLSchema.xsd line 896
element xs:enumeration
Schemas: type restriction 230 enumeration value 1 invalid
compilation error: file
http://www.w3.org/2001/XMLSchema.xsd line 1009
element xs:enumeration
Schemas: type restriction 251 enumeration value ##targetNamespace invalid
compilation error: file
http://www.w3.org/2001/XMLSchema.xsd line 1010
element xs:enumeration
Schemas: type restriction 251 enumeration value ##local invalid
compilation error: file
http://www.w3.org/2001/XMLSchema.xsd li
..
..
..
[more similar errors]
$ xmllint --version
xmllint: using libxml version 20511
compiled with: FTP HTTP HTML C14N Catalog DocBook XPath XPointer
XInclude Iconv Unicode Regexps Automata Schemas
Strange thing is,
`xmllint --noout --schema
http://www.w3.org/2001/XMLSchema.xsd test.xsd`
works just fine on my windows system (the errors I get are on my linux
system, where I need this to work:
D:\xml> xmllint --noout --schema test.xsd test.xml
test.xml validates
D:\xml> xmllint --noout --schema
http://www.w3.org/2001/XMLSchema.xsd
test.xsd
test.xsd validates
D:\xml> xmllint --version
xmllint: using libxml version 20623CVS2717
compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 FTP
HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude Iconv
Unicode Regexps Automata Expr Schemas Schematron Modules Debug
---
So why does it work on one but not the other? (And yes the Linux system has
full access to the internet.)
--
Stan