id for simpleType

nuggler

New Member
I am new to xml. I want to store a list of keywords in an XML document. I also need an ID to assign the keywords to articles that will be stored in the XML, too. I will then use the IDREFUntil now I have the following XSD:\[code\]<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="http://stackoverflow.com/questions/11213964/1"/> </restriction></simpleType> <element name="keywords" type="tns:keywordList"></element>\[/code\]And the following test XML:\[code\]<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>\[/code\]Unfortunately I have the following validation error for the \[code\]id-values\[/code\]: \[quote\] cvc-type.3.1.1: Element 'dss:keyword' is a simple type, so it cannot have attributes, excepting those whose namespace name is identical to 'http://www.w3.org/2001/XMLSchema-instance' and whose [local name] is one of 'type', 'nil', 'schemaLocation' or 'noNamespaceSchemaLocation'. However, the attribute, 'id' was found. dummy.xml /HelloWorld\[/quote\]What could be the reason for such error?
 
Back
Top