AW: use cases of xs:any [strict, lax]

Hello Mukul, Michael,

as Michael already said, processContents can be useful when dealing with schema includes from other namespaces. We've used this case for our metaformat XStandoff that allows other xsds to be imported as child elements of pre-defined 'wrapper elements' such as meta (for metadata information) and resourceContent (both using 'namespace="##other"' and 'processContents="lax"' in the xsd) and 'processContents="skip"' for our update element that is part of a log of modifications to other elements. Since previous versions of the element are stored underneath this element, we would otherwise ran into validation issues because of duplicate identifiers.

If you need further information have a look at the schema files at xstandoff.net.

Regards,

Maik Stührenberg

-- 
Dr. Maik Stührenberg
Plattformen und Serverdienste
BITS - Bielefelder IT-Servicezentrum

Universität Bielefeld
Universitätsstraße 25
33615 Bielefeld

Telefon: +49 521 106-12451
Fax: +49 521 106-1512451
E-Mail: maik.stuehrenberg@uni-bielefeld.de
http://www.uni-bielefeld.de/bits


> -----Ursprüngliche Nachricht-----
> Von: Michael Kay <mike@saxonica.com>
> Gesendet: Dienstag, 19. März 2019 11:09
> An: Mukul Gandhi <gandhi.mukul@gmail.com>
> Cc: xmlschema-dev@w3.org
> Betreff: Re: use cases of xs:any [strict, lax]
> 
> They basically define different extensibility policies. xs:any means "other
> elements can go here". With processContents="skip", it's "any other
> elements (subject to namespace constraints)". With "strict", it's "any other
> elements provided they are defined in the schema" -- which will typically be
> an extra schema module linked in using xs:include/import. With "lax" it's "any
> other elements, but if there is a schema definition for the element, then the
> element will be validated against the relevant definition".
> 
> You ask for use cases -- i.e. situations where those three policies would be
> appropriate. That's tougher. Deciding an extensibility policy for a schema you
> are writing depends on an understanding of the kind of users you will have,
> and how much you want to allow them to vary their usage from the core
> standard. This may depend, for example, on whether you are only publishing
> a schema, or whether you are also publishing applications that
> generate/consume data conforming to the schema.
> 
> Michael Kay
> Saxonica
> 
> > On 19 Mar 2019, at 05:22, Mukul Gandhi <gandhi.mukul@gmail.com>
> wrote:
> >
> > Hi all,
> >    I'm not very clear, what are the good use cases of following forms of XSD
> xs:any wildcards,
> >
> > <xs:any processContents="strict" .../>
> >
> > <xs:any processContents="lax" .../>
> >
> > Can anyone please explain this.
> >
> > I can readily imagine that, the form <xs:any processContents="skip" .../> is
> very useful.
> >
> >
> >
> >
> > --
> > Regards,
> > Mukul Gandhi
> 

Received on Tuesday, 19 March 2019 10:22:17 UTC