问题
I need to put a reference to an XML-schema (xsd) into an XML-node. It should look like this:
<root>
<!--reference to xsd-->
<child1/>
<child2/>
</root>
At the place of the comment should be a link to some schema. Is there a standard way to do this?
回答1:
This is a good link to start reading about referencing schema documents in XML documents; it gives you a description of the two attributes, xsi:noNamespaceSchemaLocation and xsi:schemaLocation used for this purpose.
回答2:
Do you want to do something like what schemaLocation
attribute does.
(I may have misunderstood your question though).
来源:https://stackoverflow.com/questions/9513825/how-to-reference-an-xsd-schema-in-an-xml-node