[
Lists Home |
Date Index |
Thread Index
]
Hi Tom,
> It's not clear to me that appinfo is considered part of the element
> declaration
If you have a look at Section 3.3.1 of XML Schema Structures at
http://www.w3.org/TR/xmlschema-1/#Element_Declaration_details, you'll
see the description of the Element Declaration Schema Component. This
lists a number of properties:
{name}
An NCName as defined by [XML-Namespaces].
{target namespace}
Either ·absent· or a namespace name, as defined in [XML-Namespaces].
{type definition}
Either a simple type definition or a complex type definition.
{scope}
Optional. Either global or a complex type definition.
{value constraint}
Optional. A pair consisting of a value and one of default, fixed.
{nillable}
A boolean.
{identity-constraint definitions}
A set of constraint definitions.
{substitution group affiliation}
Optional. A top-level element definition.
{substitution group exclusions}
A subset of {extension, restriction}.
{disallowed substitutions}
A subset of {substitution, extension, restriction}.
{abstract}
A boolean.
{annotation}
Optional. An annotation.
That bottom one there is {annotation}. If you skip down to Section
3.13.1 at http://www.w3.org/TR/xmlschema-1/#Annotation_details, you'll
see the description of the Annotation Schema Component. It lists a
number of properties:
{application information}
A sequence of element information items.
{user information}
A sequence of element information items.
{attributes}
A sequence of attribute information items.
Further down (Section 3.13.2) it says that when an xs:annotation
element is translated into an Annotation Schema Component, the
{application information} property is:
A sequence of the <appinfo> element information items from among the
[children], in order, if any, otherwise the empty sequence.
How do these schema components get into the PSVI? Well, if you skip to
Section 3.3.5, the Schema Information Set Contribution: Element
Declaration (http://www.w3.org/TR/xmlschema-1/#sic-elt-decl) states
that each element information item in the PSVI has either an [element
declaration] or a [nil] property. If it has the [element declaration]
property then the value of this property is:
an ·item isomorphic· to the declaration component itself
That "item isomorphic" stuff means that there's an information item in
the PSVI that has the same properties as the element declaration
schema component -- it has an [annotation] property, for example,
which holds an item isomorphic to the annotation schema component, and
thus has a [application information] property, which holds a sequence
of element information items.
> - in your example it contained a lookup table that the schema
> processor wouldn't know anything about. I've always assumed that
> appinfo was outside of the schema-known information about the
> element. I can understand an argument that it should be included,
> but I haven't found anything so far that actually says so.
The schema validator doesn't know what to do with the [annotation]
component of the element declaration, but that doesn't mean it throws
the information away. It retains it as a bit of XML, specifically so
that applications that use the PSVI can access that application
information if they want to.
Say that there was a DOM interface to the PSVI -- I'd expect to be
able to do something like:
Element ele = document.getDocumentElement();
if (!ele.isNil()) {
ElementDeclaration decl = ele.getElementDeclaration();
if (decl.hasAnnotation()) {
Annotation ann = decl.getAnnotation();
NodeList appinfo = ann.getApplicationInformation();
}
}
Each of the nodes in the appinfo nodelist being a xs:appinfo element
node.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
|