PhoenixmlDb.XQuery
XsdSchemaProvider
implementation backed by . Provides full XSD validation, type annotations, and schema-element/attribute matching.
#XsdSchemaProvider
Namespace: PhoenixmlDb.XQuery
implementation backed by
. Provides full XSD validation, type annotations, and schema-element/attribute matching.
#Constructors
##ctor
Creates an empty schema provider. Use
or
to load schemas.
##ctor(String[])
Creates a schema provider with one or more XSD files pre-loaded.
#Methods
#Add(String)
Loads an XSD schema from a file path.
#Add(String,IO.TextReader)
Loads an XSD schema from a
.
#AddFromString(String,String)
Loads an XSD schema from an inline string.
#RememberNamespaceId(String)
Records the (NamespaceId → URI) mapping for a URI a caller has just registered with the provider. The id is computed using the same hash scheme that
SchemaFeatureChecker
uses, so subsequent lookups against XdmQNames built by that checker round-trip correctly. Built-in XSD/XML/XSI URIs are pre-registered and not re-hashed.
#TryCastToSchemaSimpleType(String,String,String)
Validates a lexical value against a schema-defined simple type, for cast/castable. The facet checking is XmlSchemaDatatype.ParseValue's, not ours: it already enforces pattern, enumeration, length, bounds and whitespace for every XSD simple type, including unions and lists. Reimplementing that in the engine would be both large and worse.
#ValidateAndAnnotate(String,PhoenixmlDb.XQuery.INodeBuilder,PhoenixmlDb.XQuery.ValidationMode,String,String)
Validates
against the loaded schemas and returns a freshly built XDM tree whose elements/attributes carry
TypeAnnotation
values from
SchemaInfo.SchemaType
. Throws
(XQDY0027) on validation failure.
#Fields
| Name | Description |
|---|---|
_namespaceUriById
|
Maps NamespaceId values seen in inbound XdmQName parameters back to namespace URIs. Populated as schemas are loaded (built-in XSD/XML/XSI ids registered up-front, and any arbitrary URI's hash-based id added on first encounter via XsdSchemaProvider.RememberNamespaceId). Solves the lossy NamespaceId-from-URI hashing problem for the QName-based lookup methods — the URI-string overloads sidestep this entirely and should be preferred where possible.
|