nntp2http.com
Posting
Suche
Optionen
Hilfe & Kontakt

XSD Attribute

Von: micha goe (michael.pfuetz@sartorius.com) [Profil]
Datum: 09.07.2007 11:27
Message-ID: <1183973221.489357.287030@22g2000hsm.googlegroups.com>
Newsgroup: de.comp.standards
Hallo,

ich will für den folgenden Teil einer XML-Datei ein Schemata
erstellen:
...
<Option_C>
<Option_D>
<Option>
<Name Txt="FFFF">Hallo</Name>
<Code/>
<Check/>
</Option>
...
</Option_D>
</Option_C>
...
-------------------------
<xsd:element name="Option_C">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Option_D" type="Option_D"/>
...
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:complexType name="Option_D">
<xsd:sequence>
<xsd:element name="Option" type="OptionType"
id="ID_BLABLA"/>
....
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="OptionType">
<xsd:sequence>

<xsd:element name="Name" type="xsd:string">
<xsd:attribute name="Txt" use="required"
type="xsd:string"/>
</xsd:element>

<xsd:element name="Code">
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedLong">
<xsd:minInclusive value="0"/>
<xsd:maxExclusive value="9999999999"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>

<xsd:element name="Check">
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedLong">
<xsd:minInclusive value="0"/>
<xsd:maxExclusive value="9999999999"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>

</xsd:sequence>
</xsd:complexType>

Leider bekomme ich den Teil für das Attribute "Txt" nicht hin:
---------------
DOMDocument::schemaValidate() Generated Errors!
Error 3033: Element '{http://www.w3.org/2001/XMLSchema}element': The
content is not valid. Expected is (annotation?, ((simpleType |
complexType)?, (unique | key | keyref)*)).
---------------

Kann mir jemand einen Tipp geben?

Danke + Grüße

Michael


[ Auf dieses Posting antworten ]

Antworten