I have a java application where i can map a XSD type to another with same type. Now i have requirement to have one anyType xsd to which i can map any type. Like as we have O
Yes, it's possible. The type is xsd:anyType
. Here's an example:
<xsd:element name="anything" type="xsd:anyType"/>
(Taken from the primer)
Here's a more complex example:
<xsd:complexType>
<xsd:complexContent>
<xsd:restriction base="xsd:anyType">
<xsd:attribute name="currency" type="xsd:string"/>
<xsd:attribute name="value" type="xsd:decimal"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
(From the primer as well - it's worth looking at at it)
You could use the xs:any element - this allows you to have a section of you schema that can contain any arbitrary XML.