I try to achive the opposite of here. I have an abstract class, but I do not want the abstract class' type and tag to be outputted. So I need an output, which basically looks like
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<dokument ausgabe="ausgabe_test.doc" vorlage="vorlage_test.dot">
<marke typ="text" name="test">
<text>This is a test</text>
</marke>
</dokument>
rather than
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<dokument ausgabe="ausgabe_test.doc" vorlage="vorlage_test.dot">
<marke typ="text" name="test">
<inhalt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="text">
<text>This is a test</text>
</inhalt>
</marke>
</dokument>
Text
is inherited from the abstract class Inhalt
.
My current (generated) schema is shown below.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="dokument" type="dokument"/>
<xs:complexType name="dokument">
<xs:sequence>
<xs:element name="marke" type="marke" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="vorlage" type="xs:string" use="required"/>
<xs:attribute name="ausgabe" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="marke">
<xs:sequence>
<xs:element name="inhalt" type="inhalt"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="typ" type="markenTyp" use="required"/>
</xs:complexType>
<xs:complexType name="inhalt" abstract="true">
<xs:sequence/>
<xs:attribute name="style" type="xs:string"/>
</xs:complexType>
<xs:complexType name="text">
<xs:complexContent>
<xs:extension base="inhalt">
<xs:sequence>
<xs:element name="text" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:simpleType name="markenTyp">
<xs:restriction base="xs:string">
<xs:enumeration value="text"/>
<xs:enumeration value="tabelle"/>
<xs:enumeration value="liste"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>