Here is a list of the ways that an element or attribute may specify its value space ... is the list complete?

Hi Folks,

An XML Schema document "declares" elements and attributes. The set of valid values for an element or attribute (i.e., its value space) may be specified in a variety of ways.

Below is a list of ways that an element or attribute may specify its value space. Is this a complete list? Have I missed any?

Note: determining the value space of an element or attribute has been complicated in XML Schema 1.1 due to:

a. The <assert> element. An element or attribute's value space may be reduced (never expanded) by an <assert> element, which may be anywhere up the element or attribute's ancestor chain.

b. The <alternative> element. An element's value space may be reduced (never expanded) by child <alternative> elements.

To simplify the problem of determining an element or attribute's value space, I will ignore the <assert> and <alternative> elements. Therefore, I am determining the "worst case" value space of an element or attribute


Consider an element. It is "declared" in an XML Schema. The element's worst case value space is one of these:

1. The element declaration has a "fixed" attribute, so its value space is fixed. 

2. The element declaration has a "type" attribute and its value is one of the XML Schema data types, so the element's value space is the value space of the XML Schema data type.

3. The element declaration has a "type" attribute and its value is the QName of a user-defined named type, so the element's value space is the value space of the user-defined name type.

4. The element declaration has a complexType child element, so the element's value space is the value space of the complexType.

5. The element declaration has a simpleType child element, so the element's value space is the value space of the simpleType.

6. The element declaration has a "ref" attribute, so the element's value space is the value space of the ref'ed element.

7. The element declaration doesn't specify a type, so its value space is xsd:anyType.


Consider an attribute. It is "declared" in an XML Schema. The attribute's worst case value space is one of these:

1. The attribute declaration has a "fixed" attribute, so its value space is fixed. 

2. The attribute declaration has a "type" attribute and its value is one of the XML Schema data types, so the attribute's value space is the value space of the XML Schema data type.

3. The attribute declaration has a "type" attribute and its value is the QName of a user-defined named simpleType, so the attribute's value space is the value space of the user-defined name simpleType.

4. The attribute declaration has a simpleType child element, so the attribute's value space is the value space of the simpleType.

5. The attribute declaration has a "ref" attribute, so the attribute's value space is the value space of the ref'ed attribute.

6. The attribute declaration doesn't specify a type, so its value space is xsd:anyType.


/Roger

Received on Friday, 27 May 2011 14:06:07 UTC