How to specify free xml using a schema?

M

M?ht?n

Hi all,

I've got an XML file that I'm using for communication via SOAP.
Now the XML format contains several mandatory fields, but I also need
the possibility to pass random XML in one specific field. E.g.:

<package>
<origin>
<name>Martijn</name>
<country>NL</country>
</origin>
<data>
<id>QLF00256943</id>
<description>...</description>
<customXML>
<rubbish>fl..t</rubbish>
</customXML>
</data>
</package>

All these fields have been defined in the XSD. However, I don't want
the <customXML> element's contents to be checked (except for valid XML
formatting).

How can I do that?

Thanks,
Martijn
 
M

Martin Honnen

M?ht?n wrote:

I've got an XML file that I'm using for communication via SOAP.
Now the XML format contains several mandatory fields, but I also need
the possibility to pass random XML in one specific field. E.g.:

<package>
<origin>
<name>Martijn</name>
<country>NL</country>
</origin>
<data>
<id>QLF00256943</id>
<description>...</description>
<customXML>
<rubbish>fl..t</rubbish>
</customXML>
</data>
</package>

All these fields have been defined in the XSD. However, I don't want
the <customXML> element's contents to be checked (except for valid XML
formatting).

In your schema use
<xs:element name="customXML">
<xs:complexType>
<xs:sequence>
<xs:any processContents="skip" minOccurs="1"
maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top