Any Attribute in einer Enumeration? Geht das?
heine
- xml
Hallo
ich hab da eine kleine Frage zu XML Schemata. Vieleicht weiß ja jemand von
euch was dazu.
Ich hab ein Attribute, welches eine Enumeration hat in der feste Werte
vorgegeben sind. Ich hätte jetzt gerne, dass man dort diese Werte eingeben
kann ODER irgendwas. Also müsste da so ein any enumeration rein, aber ich
hab nichts finden können wir man das in diesem Fall machen kann.
Sieht so aus:
<xs:attribute name="mtype" use="required">
xs:simpleType
<xs:restriction base="xs:string">
<xs:enumeration value="SYS"/>
<xs:enumeration value="DIA"/>
<xs:enumeration value="POULSE"/>
<xs:enumeration value="HEIGHT"/>
<xs:enumeration value="WEIGHT"/>
-- hier müsste das any rein --
</xs:restriction>
</xs:simpleType>
</xs:attribute>
Grüße
martin
Hallo Martin,
Ich hab ein Attribute, welches eine Enumeration hat in der feste Werte
vorgegeben sind. Ich hätte jetzt gerne, dass man dort diese Werte eingeben
kann ODER irgendwas.
Ohne selbst jemals irgendwas mit XML Schema gemacht zu haben, wäre mein Tipp, dass folgendes funktionieren müsste:
<xs:attribute name="mtype" use="required">
xs:simpleType
xs:union
xs:simpleType
<xs:restriction base="xs:string">
<xs:enumeration value="SYS"/>
<xs:enumeration value="DIA"/>
<xs:enumeration value="POULSE"/>
<xs:enumeration value="HEIGHT"/>
<xs:enumeration value="WEIGHT"/>
</xs:restriction>
</xs:simpleType>
xs:simpleType
<xs:restriction base="xs:string" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:attribute>
Viele Grüße,
Christian
Sehr gut. So gehts. Vielen dank!
Hallo Martin,
Ich hab ein Attribute, welches eine Enumeration hat in der feste Werte
vorgegeben sind. Ich hätte jetzt gerne, dass man dort diese Werte eingeben
kann ODER irgendwas.Ohne selbst jemals irgendwas mit XML Schema gemacht zu haben, wäre mein Tipp, dass folgendes funktionieren müsste:
<xs:attribute name="mtype" use="required">
xs:simpleType
xs:union
xs:simpleType
<xs:restriction base="xs:string">
<xs:enumeration value="SYS"/>
<xs:enumeration value="DIA"/>
<xs:enumeration value="POULSE"/>
<xs:enumeration value="HEIGHT"/>
<xs:enumeration value="WEIGHT"/>
</xs:restriction>
</xs:simpleType>
xs:simpleType
<xs:restriction base="xs:string" />
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:attribute>Viele Grüße,
Christian