W3C home > Mailing lists > Public > xmlschema-dev@w3.org > May 2002

Re: How to validate xml with undefined elements and attributesl

From: Eddie Robertsson <erobertsson@allette.com.au>
Date: Mon, 06 May 2002 10:04:12 +1000
Message-ID: <3CD5C87C.171CEF5F@allette.com.au>
To: NeilS <neil.saxton@ntlworld.com>
CC: xmlschema-dev@w3.org
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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:01 UTC