Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xml simpleType的id_Xml_Xsd - Fatal编程技术网

Xml simpleType的id

Xml simpleType的id,xml,xsd,Xml,Xsd,我是xml新手 我想在XML文档中存储关键字列表。我还需要一个ID来将关键字分配给将存储在XML中的文章。然后我将使用IDREF 到目前为止,我有以下XSD: <complexType name="keywordList"> <sequence> <element name="keyword" type="tns:tag" minOccurs="0" m

我是xml新手

我想在XML文档中存储关键字列表。我还需要一个ID来将关键字分配给将存储在XML中的文章。然后我将使用IDREF

到目前为止,我有以下XSD:

<complexType name="keywordList">
    <sequence>
        <element name="keyword" 
              type="tns:tag" 
              minOccurs="0" 
              maxOccurs="unbounded"/>
    </sequence>
</complexType>

<simpleType id="ID" name="tag">
    <restriction base="string">
        <minLength value="1"/>
    </restriction>
</simpleType>

  <element name="keywords" type="tns:keywordList"></element>


以及以下测试XML:

<dss:keywords xmlns="http://dss.in.tum.de/" xmlns:dss="http://dummy"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://dummy dummy.xsd >
    <dss:keyword id="K1">testing</dss:keyword>
    <dss:keyword id="k2">requirements</dss:keyword>
    <dss:keyword id="k3">modelling</dss:keyword>
    <dss:keyword id="k4">implementation</dss:keyword>
</dss:keywords>

关键字
必须是复杂类型。只有复杂类型才能具有属性。它将是具有简单内容的复杂类型。