我很难搜索这个。我如何在XML的XML模式文件中定义一个元素,如下所示:
<option value="test">sometext</option>
我不知道如何定义一个类型为xs:string的元素,并且还有一个属性。
这里是我到目前为止:
<xs:element name="option"> <xs:complexType> <xs:attribute name="value" type="xs:string" /> </xs:complexType> </xs:element>
尝试
<xs:element name="option" type="AttrElement" /> <xs:complexType name="AttrElement"> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="value" type="xs:string"> </xs:attribute> </xs:extension> </xs:simpleContent> </xs:complexType>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。