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.
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[])
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.
#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.