How to reference XSD in XML for W3C Markup Validation Service? -


i create xml follows xml schema http://www.oid-info.com/oid.xsd . xsd should somehow referenced in xml file, tool https://validator.w3.org/ can check find errors in semantics of data, e.g. when email address invalid.

first, tried way:

<?xml version="1.0" encoding="iso-8859-1" ?> <oid-database xmlns="http://www.oid-info.com/" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.oid-info.com/oid.xsd"> <submitter> .... </submitter> <oid> .... </oid> </oid-database> 

the w3c markup validation service says:

no doctype found! checking xml syntax only. doctype declaration not recognized or missing. means formal public identifier contains spelling error, or declaration not using correct syntax, or xml document not using doctype declaration. validation of document has been skipped, , simple check of well-formedness of xml syntax has been performed instead.

ok, tried use doctype

<?xml version="1.0" encoding="iso-8859-1" ?> <!doctype oid-database> <oid-database xmlns="http://www.oid-info.com/" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.oid-info.com/oid.xsd"> <submitter> .... </submitter> <oid> .... </oid> </oid-database> 

now w3c validator says:

line 2, column 23: no internal or external document type declaration subset; parse without validation

i know dtd is, , have worked dtds in past. know dtd missing here. want check against xsd, , not against dtd.

what have make work?

that w3c validator check well-formedness , validate against dtd; doesn't validate against xsd. you'll have use on- or off-line validator.

also, here how xml file should hint should validated valid against oid xsd:

<?xml version="1.0" encoding="utf-8" ?> <oid-database xmlns="http://oid-info.com"               xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"               xsi:schemalocation="http://oid-info.com                                    http://www.oid-info.com/oid.xsd">   <submitter>     ....   </submitter>   <oid>     ....   </oid> </oid-database> 

see also: how link xml xsd using schemalocation or nonamespaceschemalocation?

note xsds appear have own issues, including:

[warning] xhtml-light.xsd:8:36: schema_reference.4: failed read schema document 'xml.xsd', because 1) not find document; 2) document not read; 3) root element of document not .

[error] oid.xsd:91:46: invalidregex: pattern value '{?\s*(((([a-z][a-za-z0-9-]\s((\s*(0|[1-9][0-9])\s))?|(0|[1-9][0-9]))){2,}\s)|((0|[1-9][0-9])(.(0|[1-9][0-9]))))\s}?' not valid regular expression.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -