在尝试生成我的XSD时,我正在遇到这个错误,无法弄清楚我做错了什么;我的代码看起来像这样:
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3schools.com" xmlns="http://www.w3schools.com" elementFormDefault="qualified"> <xs:element name="FICH"> <xs:complexType> <xs:sequence> <xs:element name="cabeza"> <xs:complexType> <xs:sequence> <xs:element name="VERSION_ORIG" type="Version"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="DATA_MAJ"> <xs:complexType> <xs:sequence> <xs:element name="DATA1" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="VERSION_SIT_NOM" type="Version"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> <xs:assert test="CABEZA/VERSION_ORIG = DATA_MAJ/VERSION_SIT_NOM"/> </xs:complexType> </xs:element> <xs:simpleType name="YYMM"> <xs:restriction base="xs:integer"> <xs:pattern value="[0-9]{2}[01|02|03|04|05|06|07|08|09|10|11|12]"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="Version"> <xs:restriction base="xs:string"> <xs:pattern value="[0-9]{2}.[0-9]{2}.[0-9]{2}"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="emptyString"> <xs:restriction base="xs:string"> <xs:enumeration value=""/> </xs:restriction> </xs:simpleType> </xs:schema>
我们的想法是元素CABEZA / VERSION_ORIG必须等于DATA_MAJ / VERSION_SIT_NOM.我正在寻找一些解决方案,但一切似乎都适合我.
提前致谢
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。