我有 2 个 XSD 文件。
假设一个 XSD 文件 ABC.xsd 包含属于 XML 一部分的元素。
另一个 XSD 文件假设 XYZ.xsd 包含这些元素的定义。
现在,在 ABC.XSD(保存元素)模式标记以及其他命名空间中,我们也提到了模式位置
<xs:schema schemaLocation="XYZ.xsd">
当我执行 xsd.exe 来生成我的 C# 类时。它正在生成类,但缺少 XYZ.xsd 中的一些定义。
我正在执行
xsd.exe "ABC.xsd" "XYZ.xsd" /c
任何帮助,将不胜感激
EDIT 1:@Felice,在我的 XYZ.xsd 中我有这样的定义
<xs:simpleType name="contactNumberType">
<xs:annotation>
<xs:documentation>Contact phone or fax number with national or international format. Only numbers are allowed</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="\+?\p{N}{6,24}"/>
</xs:restriction>
</xs:simpleType>
请参阅此处定义的模式,它没有出现在 C# 类中。任何帮助。抱歉,我对此很陌生。
谢谢你的回答有效
引用主要 XSD 对我来说不起作用。
我必须按照此链接引用依赖的 XSD 文件
http://bembengarifin.wordpress.com/2009/07/14/generate-net-class-from-xsd-with-references-to-other-xsd-using-xsd-exe/ http://bembengarifin.wordpress.com/2009/07/14/generate-net-class-from-xsd-with-references-to-other-xsd-using-xsd-exe/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)