Defining an alias for an XML element in an XSD schema

Is XSD support supported or tricks (e.g. through a preprocessor) to define an alias for an XML element? I would like to add an alias for all the elements in my schema to create an option for a more critical, but bandwidth-efficient version of our XML documents.

For example, I would like to define a name such as IRQto be an alias for an element InterruptRequest, etc.

<xs:element name="InterruptRequest" minOccurs="0">
    <xs:complexType>
        <xs:attribute name="level" type="xs:unsignedShort" use="required"/>
    </xs:complexType>
</xs:element>

So the following two declarations are equivalent to each other

<!-- Human readable but bandwidth inefficient -->
<InterruptRequest level="22" /> 

<!-- Cryptic, but comparatively bandwidth efficient -->
<IRQ level="22" />
+5
source share
1 answer

, , . - - , , .

<element name="a">...

<element name="b" substitutionGroup="a">...
+7

All Articles