How to define XSD to allow any XML element as child element
While working on a new feature for WSO2 GREG i came across a requirement to allow any arbitrary XML element to be passed as a child element and i needed to define this in an XSD file. After a bit of searching and some help i was able to find the correct XSD structure for this and thought i might be helpful to share it
The given XSD will allow an XML such as the example given below
Hope this is helpful to anyone who needs to to configure an XSD for a similar situation
<xs:element maxoccurs="unbounded" minoccurs="0" name="parameter"> <xs:complextype> <xs:sequence> <xs:any maxoccurs="unbounded" minoccurs="0" processcontents="skip"> </xs:any></xs:sequence> <xs:attribute name="name" type="xs:string" use="optional"> <xs:attribute name="value" type="xs:string" use="optional"> </xs:attribute></xs:attribute></xs:complextype> </xs:element>
The given XSD will allow an XML such as the example given below
<parameter name="payload"> <p:adderprocessrequest xmlns:p="http://wso2.org/bps/sample"> <!--Exactly 1 occurrence --> <x xmlns="http://wso2.org/bps/sample">x</x> <!--Exactly 1 occurrence --> <y xmlns="http://wso2.org/bps/sample">y</y> </p:adderprocessrequest> </parameter>
athiWglyc-sa Gary High https://wakelet.com/wake/cMS5D3-jtbLv7WvG1vCBV
ReplyDeletecarsingwhisfi
Ymirueter_ku Alicia Green Install
ReplyDeleteCisco Packet Tracer
ReiBoot Pro
kolsdolocom
Oincripdia_ji Tammy Grimes Click
ReplyDeleteweddleweldi