Key, KeyRef in different XSD documents

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-22 09:57:09

问题


Is this possible?

Say for example I have

customers.xml

<customers>
    <customer>1</customer>
    <customer>2</customer>
</customers>

orders.xml

<orders>
    <order>
        <customer>1</customer>
    </order>
    <order>
        <customer>3</customer> Invalid as Customer 3 doesn't exist
    </order>
</orders>

How would the XSD (using key and keyref) look for this (customer.xsd and orders.xsd would also be two different files with different namespaces), is it even possible. All the examples I have seen deal with single files.

Can Keys and Keyrefs be spread across multiple XSD files?


回答1:


It's not possible. No XML schema construct or constraint works across multiple files.



来源:https://stackoverflow.com/questions/6914438/key-keyref-in-different-xsd-documents

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