Reputation: 2155
I am interested in knowing more about the process that allows the XML files to actually locate the schema that validates it. I'm asking after testing three different xml headers (below) and noticing that the schema correctly validates with any variant.
<root xmlns="http://www.website.com/yolo"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
<root xmlns="http://www.website.com/yolo"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.website.com/yolo http://www.website.com/yolo
"
>
<root xmlns="http://www.website.com/yolo"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.website.com/yolo /u/me/folder/yolo.xsd
"
>
Upvotes: 2
Views: 1653
Reputation: 25034
The XSD spec does not constrain the methods used by XSD validators to locate a schema for a document; it does define the xsi:schemaLocation hint to allow validators to read schema location information from the XML instance itself, but most validators accept schema bindings at invocation time. Your validator should provide documentation of how it finds schemas; you should consult that documentation.
Upvotes: 1