PhoenixmlDb.Core
XmlCatalog
An OASIS XML Catalog (XML Catalogs 1.1): a table that says where the document a URI names is really to be read from. A schema that refers to http://www.w3.org/2001/xml.xsd can so be compiled from a local copy, with nothing fetched from the network.
#XmlCatalog
Namespace: PhoenixmlDb.Core.Schema
An OASIS XML Catalog (XML Catalogs 1.1): a table that says where the document a URI names is really to be read from. A schema that refers to
http://www.w3.org/2001/xml.xsd
can so be compiled from a local copy, with nothing fetched from the network.
Every entry of the specification is supported: uri, system, public, rewriteURI, rewriteSystem, uriSuffix, systemSuffix, delegateURI, delegateSystem, delegatePublic, group, nextCatalog, with xml:base and prefer where they apply. Names are compared after the normalization the specification gives (§6.3, §6.4): characters a URI may not hold are percent-encoded, and a urn:publicid: name is read as the public identifier it stands for.
A catalog that an entry delegates to is read when the catalog is loaded, with the rest, and not when a name is first looked up: a loaded catalog does not change and reads nothing.
A catalog only renames. What it maps a URI to is then read like any other document, from a supplied SchemaSource or through the ISchemaAccessGate, which sees the mapped URI. The catalog files themselves, and every nextCatalog, are read the same way when the catalog is loaded; one that cannot be read fails the load.
A catalog file may have a document type declaration, as most do. It is skipped: nothing is fetched for it and no entity it declares is used.
#Properties
| Name | Description |
|---|---|
Documents
|
The catalog files that were read, each with the version read. |
Empty
|
A catalog with no entries. |
Identity
|
Names what the catalog says, derived from its entries: two catalogs with the same entries in the same order have the same identity. Part of what a cached schema is found by. |
#Methods
#Delegates(Collections.Generic.List<PhoenixmlDb.Core.Schema.XmlCatalog.Entry>,String,PhoenixmlDb.Core.Schema.XmlCatalog.Kind,Boolean)
The delegate entries whose prefix the name starts with, the longest prefix first.
#Load(Collections.Generic.IEnumerable<Uri>,PhoenixmlDb.Core.Schema.ISchemaAccessGate,Collections.Generic.IEnumerable<PhoenixmlDb.Core.Schema.SchemaSource>,PhoenixmlDb.Core.Schema.SchemaCompileOptions)
for a caller that cannot wait asynchronously; it blocks the calling thread until the gate and the sources have answered.
#LoadAsync(Collections.Generic.IEnumerable<Uri>,PhoenixmlDb.Core.Schema.ISchemaAccessGate,Collections.Generic.IEnumerable<PhoenixmlDb.Core.Schema.SchemaSource>,PhoenixmlDb.Core.Schema.SchemaCompileOptions,Threading.CancellationToken)
Loads the catalog files at
and every catalog they name as next.
Parameters:
-
catalogs— The absolute URIs of the catalog files, in the order they are consulted. -
gate— Reads every catalog file thatsourcesdoes not supply. -
sources— Catalog files the host supplies, each named by its URI. -
limits— The size limits for what is read;SchemaCompileOptions.Defaultwhen null. -
cancellationToken— Given to the gate and the sources.
Exceptions:
-
SchemaCompilationException— A catalog file is not available, is too large, is not well-formed, or there are more thanXmlCatalog.MaxCatalogFilesof them.
#NormalizePublicId(String)
Public identifiers compare with their white space normalized (XML Catalogs §6.2).
#NormalizeUri(String)
A system identifier or URI as it is compared (XML Catalogs §6.3): each character a URI may not hold is replaced by the percent-encoding of its UTF-8 bytes. A percent sign is left as it is, so a name that is already encoded is not encoded again.
#Parse(Byte[],PhoenixmlDb.Core.Schema.SchemaDocumentRequest,Collections.Generic.List<PhoenixmlDb.Core.Schema.XmlCatalog.Entry>)
Reads one catalog file's entries into
, and returns the catalogs it names as next and, for each delegate entry (by its index), the catalog it names.
#ResolveExternalIdentifier(String,String)
Where an external identifier is to be read from (XML Catalogs §7.1.2), or null. The system identifier is looked up first. The public identifier is looked up after it, in the
public
and
delegatePublic
entries that
prefer="public"
is in force for; when there is no system identifier, in all of them.
Parameters:
-
publicId— The public identifier, or null. -
systemId— The system identifier, or null.
#ResolveName(Collections.Generic.List<Collections.Generic.List<PhoenixmlDb.Core.Schema.XmlCatalog.Entry>>,String,Boolean,Int32)
One kind of name (URI or system identifier) in one list of catalog files. A file whose delegate entries match the name ends the lookup: the answer is what the catalogs they name say, and the files after it are not asked.
#ResolvePublic(String)
Where the document with the public identifier
is to be read from, or null.
#ResolveUri(String)
Where the document named by
is to be read from, or null when the catalog says nothing about it. The
uri
entries are tried, then the
system
ones; in each, an exact name before the longest matching rewrite prefix before the longest matching suffix before delegation. A file's entries are all tried before the files it names as next. A
urn:publicid:
name is looked up as a public identifier.
#UnwrapPublicIdUrn(String)
The public identifier a
urn:publicid:
name stands for (XML Catalogs §6.4), or null when the name is not one.
#Fields
| Name | Description |
|---|---|
MaxCatalogFiles
|
The most catalog files one load reads, through nextCatalog. |
MaxDelegationDepth
|
How deep one lookup follows delegation; a catalog that delegates to itself ends there. |