Re: How to validate xml with undefined elements and attributesl

Hi Neil,

> I have tried using the any element but MSXML4 produces an error as it
> is unable to interpet the any as belonging to anthing other than those
> elements I have already declared.
> +++++++++++++++++
>
>
> That's because the processContents attribute on the xs:any element
> defaults to "strict". "strict" means that there must exist a
> declaration for all the elements that are included as part of the
> xs:any declaration.
> If you don't want the schema processor to validate the contents of the
> xs:any element then you should set the processContents attribute to
> "skip". So you should have:
>  <any namespace="##any" processContents="skip" minOccurs="0"
> maxOccurs=unbounded"/>
>
> Note, you can also set the value to "lax" which means that if the
> schema processor can find a declaration for the elements you include
> as any then they will be validated otherwise validation will be
> skipped.
>
> Cheers,
> /Eddie
>
>  --------------------------------------------------------------e.g.<complexType><sequence><element
> name="aaaa" minOccurs="0" maxOccurs=unbounded"/><element name="bbbb"
> minOccurs="0" maxOccurs=unbounded"/><any namespace="##any"
> minOccurs="0"
> maxOccurs=unbounded"/></sequence></complexType> Thanks Neil

Received on Sunday, 5 May 2002 19:51:57 UTC