How to reference an xsd-Schema in an xml-node

寵の児 提交于 2020-01-06 05:45:30

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!