Re: how to define an element which can contain any attributes or elements

Michael Anderson <michael@research.canon.com.au> writes:

> Michael Burns wrote:
> 
> > Still does not work.  Gee, I thought this was a simple request :*)
> >
> > - - - snip - - -
> > Problems with the schema-validity of the target
> > file:/C:/ModelCompilerTestPen/test/xmlout/Properties.xml:5:2: Invalid per src-resolve: can't find a type for wildcard-matching element {None}:Cat
> 
> < snip >
> 
> The <any> and <anyAttribute> wildcard just mean you can have any
> globally declared element in the content model or any globally
> declared attribute.

That's at least slightly misleading, as you clarify at the end.
Martin Gudgin's reply is relevant here: exactly what
<any(Attribute)...> means has two parts:

  1) what's allowed;
  2) what happens next.

Wrt (1), the 'namespace' attribute is the _only_ thing which matters.
By default, it allows absolutely any element(attribute).

Wrt (2), the 'processContents' attribute determines:

  * 'skip' means that's it, no further processing of any kind is
    required for the containing element to be fine;

  * 'lax' means _if_ types can be found for the elements(attributes)
    allowed by the 'namespace', they should be used to validate them;

  * 'strict' means that types _must_ be found for the
    elements(attributes) allowed by the 'namespace' and used to
    validate them.

> So you still need to declare Cat, Dog etc globally.

Only if you have (as you do by default) processContents='strict', and
have not used xsi:type in the instance.

> The processor is trying to resolve Cat etc and can't find it so
> throws an error.  This is actually because the default level of
> validation is "strict" which means the processor is _required_ to
> resolve Cat etc.  To fix this to what you want, try set
> processContents = "lax" or even "skip". ie

Right.
 
> ps.  Can you reply email to me to tell me if this works as I am
> currently trying to understand exactly what "lax" means myself.
> cheers.

It better, because what you say here is correct!

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/

Received on Wednesday, 6 December 2000 18:04:40 UTC