PhoenixmlDb.Core
Xsd11Compatibility
Makes a schema document written for XSD 1.1 loadable by the XSD 1.0 processor the layer uses (System.Xml's), in the two ways the specification and practice allow.
#Xsd11Compatibility
Namespace: PhoenixmlDb.Core.Schema
Makes a schema document written for XSD 1.1 loadable by the XSD 1.0 processor the layer uses (System.Xml's), in the two ways the specification and practice allow.
Conditional inclusion (XSD 1.1 §4.2.2, the vc: versioning namespace). An element whose vc:minVersion is above 1.0, or whose vc:maxVersion is 1.0 or below, is not part of the schema for a 1.0 processor and is removed. Schemas written for both versions mark their 1.1-only parts this way, typically <xs:assert test="…" vc:minVersion="1.1"/>; loaded unprocessed the whole schema is lost for a construct it says a 1.0 processor must skip.
Built-in types XSD 1.1 added (xs:dayTimeDuration, xs:yearMonthDuration, xs:dateTimeStamp). A reference to one is rewritten to the 1.0 type it restricts, so the schema loads and a value still validates lexically against the base type. The 1.1 type's own constraint is not applied: an xs:dayTimeDuration with a year component is accepted.
An element in several substitution groups (XSD 1.1 §3.3.2: substitutionGroup is a list). The attribute keeps the first head, which a 1.0 processor reads, and every head is recorded as expanded names in Xsd11Compatibility.SubstitutionGroupsAttribute, an attribute in a namespace of this layer's that the processor keeps on the declaration (XmlSchemaElement.UnhandledAttributes), for a consumer that decides membership itself. Validation sees the first head only: an instance that substitutes the element for another head is refused.
A document that is rewritten is serialized again, so the line and column of a later diagnostic about it can differ from the original where an element was removed.
#Methods
#Apply(Byte[],String@)
The document as a 1.0 processor is to see it, or the same array when nothing in it needs rewriting. A document that is not well-formed is returned as it is, for the schema parser to report.
Parameters:
-
document— A schema document already checked for a document type declaration and for depth. -
requiresXsd11— Why the document cannot be a schema for a 1.0 processor at all, or null: itsxs:schemaelement excludes itself from version 1.0, or it uses an element only XSD 1.1 has outside anyvc:guard. Such a document is not to be given to the schema parser, whose message would not say this.
#HasListedSubstitutionGroup(Byte[])
Whether a
substitutionGroup
attribute in the bytes holds more than one name: a space after a name and before the closing quote. The attribute is common in XSD 1.0 schemas, with one name, which needs no parsing.
#MayNeedRewriting(Byte[])
Whether the bytes can hold anything to rewrite. The markers are ASCII, so they are found in any ASCII-compatible encoding; a document in another encoding (UTF-16, UTF-32) is always parsed.
#Fields
| Name | Description |
|---|---|
CompatibilityNamespace
|
The namespace of the attributes this layer adds to a schema document. |
SubstitutionGroupsAttribute
|
The local name of the attribute, in Xsd11Compatibility.CompatibilityNamespace, that lists every head of an element declared in several substitution groups, each as {uri}local, separated by spaces.
|
Xsd11Elements
|
Elements only XSD 1.1 has. A schema that uses one without a vc: guard cannot be read as XSD 1.0: there is no 1.0 schema to fall back to.
|