Hi I have just started learning about xsd as I want to use it with JAXB.
I was wondering I may have an XML tag that started with the same element but could have completely different child elements every time.
Here is an example1:
<service>Hotel
<request>location
<currentLongitude>100</currentLongitude>
<currentLatitude>100</currentLatitude>
</request>
</service>
example2:
<service>Hotel
<request>Price
<Single>130</Single>
<Double>140</Double>
</request>
</service>
Basically how do I write this in xsd that “request” being asked can have completely different elements
Or if it is applicable is their a better way for me to process this xml then JAXB?
Thanks
You can define your
requestelement as:This will cause JAXB to generate a field/property that is annotated like:
FULL EXAMPLE
any.xsd
XJC Call
Service
Request