Reputation: 2129
I have recently introduced myself to XML Schema (XSD), and I am struggling in finding answers to a few fundamental questions about them:
I've been struggling in finding answers to these questions and thank responders in advance for their contributions :)
Upvotes: 1
Views: 103
Reputation: 163322
You can use the xsi:schemaLocation attribute. However, in my view it's inherently dangerous. If you need to validate a file, that's often because you don't trust it to be valid, and if you don't trust it to be valid, why should you trust it to identify its own schema? All schema validation APIs allow you to nominate a source document S and a schema K and say "validate S against K".
There are many APIs for invoking schema validation. In some cases the operation is integrated with XML parsing, you just set an option on the XML parser. But generally you have to ask for validation, it won't happen automatically.
Upvotes: 2
Reputation: 3935
Upvotes: 1