PhoenixmlDb.Core
SchemaSource
A schema document the host supplies itself: an absolute URI that names it, and its content.
#SchemaSource
Namespace: PhoenixmlDb.Core.Schema
A schema document the host supplies itself: an absolute URI that names it, and its content.
A source is how schema text, an embedded resource or a schema held in a store reaches the layer. Its
is what an
xs:include
or
xs:import
elsewhere refers to it by, and the base its own relative references resolve against, so it is always absolute: text with no base URI would resolve its references against the process's current directory, which is not a place a schema was ever said to be. A schema on disk or on the network needs no source; it is named by URI and read through the
.
#Properties
| Name | Description |
|---|---|
Uri
|
The absolute URI that names this document. |
Version
|
A token that changes when the content does: a hash of the text, or the version id of a stored schema. A compiled schema is reused for as long as every document's token is unchanged. |
#Methods
#FromResource(Reflection.Assembly,String,Uri)
A schema embedded in
as the manifest resource
, named by
.
Exceptions:
-
ArgumentException—uriis not absolute, or the assembly has no such resource.
#FromStore(Uri,Func<Threading.CancellationToken,Threading.Tasks.ValueTask<IO.Stream>>,String)
A schema whose content the host reads on demand, such as one held in a database, named by
.
Parameters:
-
uri— The absolute URI that names the document. -
open— Opens the content. Called once for each compilation that needs it, with that compilation's cancellation token. An exception it throws reaches the caller of the compilation unchanged. -
version— A token that changes whenever the content does, such as the stored schema's version id, or a content hash for a store that keeps no versions.
Exceptions:
-
ArgumentException—uriis not absolute, orversionis empty.
#FromText(String,Uri)
Schema text, named by
.
Exceptions:
-
ArgumentException—uriis not absolute.