XML Schema und Attribut



  • Folgendes XML soll entstehen:
    <testing xsi:noNamespaceSchemaLocation="testing.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <test typ1="String" typ2="String">
    <typ1 category="String" value="String">
    <typ1 subcategory="String" value="String"/>
    <typ1 subcategory="String" value="String"/>
    <typ2 category="String" value="String"/>
    <typ2 subcategory="String" value="String"/>
    </test>
    </testing>

    Die Attribute category und subcategory dürfen jeweils nur getrennt auftreten, also category+value oder subcategory+value (NICHT: category+subcategory)
    Wie löst man das am besten bzw. wie sollte die testing.xsd aussehen?



  • guck dir mal das xsd element choice an.


Anmelden zum Antworten