SimpleType和Attribute的XML Schema?
发布时间:2020-12-16 07:53:28 所属栏目:百科 来源:网络整理
导读:我正在尝试创建一个可以捕获 XML的 XML模式,看起来像这样: tagname description="simple string type attribute"false !-- simple boolean type --/tagname 但遇到困难.甚至可以定义一个模式来捕获这个或是我在snipe hunt? 干得好 xs:element name="tagnam
我正在尝试创建一个可以捕获
XML的
XML模式,看起来像这样:
<tagname description="simple string type attribute"> false <!-- simple boolean type --> </tagname> 但遇到困难.甚至可以定义一个模式来捕获这个或是我在snipe hunt?
干得好
<xs:element name="tagname"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:boolean"> <xs:attribute name="description" type="xs:string" use="required"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> 这里是经过验证的样品 <tagname xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:/C:/Untitled2.xsd" description="123"> true </tagname> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |