Name

xs:any

Synopsis

<xs:any
  id = "ID"
  maxOccurs = "nonNegativeInteger | unbounded"
  minOccurs = "nonNegativeInteger"
  namespace = " ##any | ##other | anyURI* ##targetNamespace? ##local? "
  processContents = " lax | skip | strict ">
  <!-- xs:annotation? -->
</xs:any>

The wildcard element xs:any is useful when writing schemas for languages such as XSLT that routinely include markup from multiple vocabularies that are unknown when the schema is written. It indicates that between minOccurs and maxOccurs elements from one or more namespaces identified by the namespace attribute may appear at that position in a content model. As well as literal namespace URIs, the special value ##targetNamespace can be included in the list to indicate that any element from the schema’s target namespace can be used. The special value ##local can be included in the list to indicate that elements not in any namespace can be used. Instead of the list of namespace URIs, you can use the special value ##any to indicate that all elements from any namespace or no namespace are allowed, or the special value ##other to indicate that elements from namespaces other than the schema’s target namespace can be used.

The processContents attribute indicates whether the elements represented by xs:any have to be declared or whether they can be completely unfamiliar to the schema. It has one of these three values:

strict

Elements represented by this xs:any element must be declared or have an xsi:type attribute. Furthermore, the element ...

Get XML in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.