Re: how to define an XML Document with an unknown/variable element

Hi Remko,

> Except for the fact that the response is always an XML Document with
> the root <xsd:element name="method2Response">. Is there a way to
> define this??

Yes. Use an <xs:any> wildcard in the content model for your element:

<xs:element name="method2Response">
  <xs:complexType>
    <xs:sequence>
      <xs:any />
    </xs:sequence>
  </xs:complexType>
</xs:element>

You can put minOccurs/maxOccurs attributes on the wildcard if there
are multiple elements within the method2Response element.

You can also use the namespace attribute on <xs:any> if you want to
limit the namespaces that the elements can belong to.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

Received on Wednesday, 9 July 2003 04:58:33 UTC