1
In XML-Schema, wie definiere ich eine ComplexType
, die wie folgt rendert?XML-Element mit Attribut und String-Inhalt
<ValidationError code="X501">I love cats!</ValidationError>
Wenn ich die folgenden meine Werkzeuge versuchen * werden sagen, es ist nicht gültig
<xsd:complexType name="ValidationErrorType">
<xsd:attribute name="code" type="xsd:string"></xsd:attribute>
<xsd:simpleContent>
<xsd:extension base="xs:string"/>
</xsd:simpleContent>
</xsd:complexType>
Werkzeuge ich verwende, sind Altova XMLSpy für die visuelle Bearbeitung und wsdl2java Klassen
-Update zu generieren: Ich habe another flavour versucht
<xsd:complexType name="ValidationErrorType">
<xsd:simpleContent>
<xsd:extension base="xs:string">
<xsd:attribute name="code" type="xsd:string" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
sagte Altova Invalid XML schema: 'Value 'xs:string' is not allowed for attribute 'base'.'