Table of Contents

Class OdfSchemaSet

Namespace
OdfKit.Compliance
Assembly
OdfKit.dll

Provides the OdfSchemaSet API. 代表單一 ODF 版本的確定性結構描述中繼資料。

public sealed class OdfSchemaSet
Inheritance
OdfSchemaSet
Inherited Members

Constructors

OdfSchemaSet(OdfVersion, Uri, string, IEnumerable<OdfElementDefinition>)

Short overload of OdfSchemaSet that accepts version, sourceUrl, sourceDate, and elements; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 version、sourceUrl、sourceDate 與 elements;其餘可選參數使用預設值並轉呼叫最長 OdfSchemaSet 多載。

public OdfSchemaSet(OdfVersion version, Uri sourceUrl, string sourceDate, IEnumerable<OdfElementDefinition> elements)

Parameters

version OdfVersion
sourceUrl Uri
sourceDate string
elements IEnumerable<OdfElementDefinition>

OdfSchemaSet(OdfVersion, Uri, string, IEnumerable<OdfElementDefinition>, IEnumerable<OdfAttributeDefinition>?)

Short overload of OdfSchemaSet that accepts version, sourceUrl, sourceDate, elements, and attributes; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 version、sourceUrl、sourceDate、elements 與 attributes;其餘可選參數使用預設值並轉呼叫最長 OdfSchemaSet 多載。

public OdfSchemaSet(OdfVersion version, Uri sourceUrl, string sourceDate, IEnumerable<OdfElementDefinition> elements, IEnumerable<OdfAttributeDefinition>? attributes)

Parameters

version OdfVersion
sourceUrl Uri
sourceDate string
elements IEnumerable<OdfElementDefinition>
attributes IEnumerable<OdfAttributeDefinition>

OdfSchemaSet(OdfVersion, Uri, string, IEnumerable<OdfElementDefinition>, IEnumerable<OdfAttributeDefinition>?, IEnumerable<OdfSchemaNameClass>?)

Short overload of OdfSchemaSet that accepts version, sourceUrl, sourceDate, elements, attributes, and nameClasses; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 version、sourceUrl、sourceDate、elements、attributes 與 nameClasses;其餘可選參數使用預設值並轉呼叫最長 OdfSchemaSet 多載。

public OdfSchemaSet(OdfVersion version, Uri sourceUrl, string sourceDate, IEnumerable<OdfElementDefinition> elements, IEnumerable<OdfAttributeDefinition>? attributes, IEnumerable<OdfSchemaNameClass>? nameClasses)

Parameters

version OdfVersion
sourceUrl Uri
sourceDate string
elements IEnumerable<OdfElementDefinition>
attributes IEnumerable<OdfAttributeDefinition>
nameClasses IEnumerable<OdfSchemaNameClass>

OdfSchemaSet(OdfVersion, Uri, string, IEnumerable<OdfElementDefinition>, IEnumerable<OdfAttributeDefinition>?, IEnumerable<OdfSchemaNameClass>?, IEnumerable<OdfSchemaPatternDefinition>?)

Performs odf schema set. 初始化結構描述中繼資料集的新執行個體。

public OdfSchemaSet(OdfVersion version, Uri sourceUrl, string sourceDate, IEnumerable<OdfElementDefinition> elements, IEnumerable<OdfAttributeDefinition>? attributes, IEnumerable<OdfSchemaNameClass>? nameClasses, IEnumerable<OdfSchemaPatternDefinition>? patterns)

Parameters

version OdfVersion

ODF 版本

sourceUrl Uri

來源 URL

sourceDate string

來源日期

elements IEnumerable<OdfElementDefinition>

元素定義集合

attributes IEnumerable<OdfAttributeDefinition>

屬性定義集合

nameClasses IEnumerable<OdfSchemaNameClass>

名稱類別集合

patterns IEnumerable<OdfSchemaPatternDefinition>

模式定義集合

Properties

Attributes

Provides the Attributes member. 取得所有屬性定義,以命名空間 URI 與區域名稱作為索引鍵。

public IReadOnlyDictionary<OdfQualifiedName, OdfAttributeDefinition> Attributes { get; }

Property Value

IReadOnlyDictionary<OdfQualifiedName, OdfAttributeDefinition>

Elements

Provides the Elements member. 取得所有元素定義,以命名空間 URI 與區域名稱作為索引鍵。

public IReadOnlyDictionary<OdfQualifiedName, OdfElementDefinition> Elements { get; }

Property Value

IReadOnlyDictionary<OdfQualifiedName, OdfElementDefinition>

NameClasses

Provides the NameClasses member. 取得從來源結構描述保留的 RELAX NG 名稱類別。

public IReadOnlyList<OdfSchemaNameClass> NameClasses { get; }

Property Value

IReadOnlyList<OdfSchemaNameClass>

Patterns

Provides the Patterns member. 取得具名 RELAX NG 模式樹,以定義名稱作為索引鍵。

public IReadOnlyDictionary<string, OdfSchemaPatternDefinition> Patterns { get; }

Property Value

IReadOnlyDictionary<string, OdfSchemaPatternDefinition>

SourceDate

Gets the SourceDate value. 取得作為 ISO 日期字串的來源日期。

public string SourceDate { get; }

Property Value

string

SourceUrl

Gets the SourceUrl value. 取得此結構描述中繼資料集所使用的官方來源 URL。

public Uri SourceUrl { get; }

Property Value

Uri

Version

Gets the Version value. 取得此中繼資料集代表的 ODF 版本。

public OdfVersion Version { get; }

Property Value

OdfVersion

Methods

ContainsElement(string, string)

Performs contains element. 傳回此中繼資料集中是否存在該元素。

public bool ContainsElement(string namespaceUri, string localName)

Parameters

namespaceUri string

命名空間 URI

localName string

區域名稱

Returns

bool

若存在則傳回 true;否則傳回 false

FindAttribute(string, string)

Finds attribute. 根據命名空間 URI 與區域名稱尋找屬性定義。

public OdfAttributeDefinition? FindAttribute(string namespaceUri, string localName)

Parameters

namespaceUri string

命名空間 URI

localName string

區域名稱

Returns

OdfAttributeDefinition

尋找到的屬性定義;若未找到則傳回 null

FindElement(string, string)

Finds element. 根據命名空間 URI 與區域名稱尋找元素定義。

public OdfElementDefinition? FindElement(string namespaceUri, string localName)

Parameters

namespaceUri string

命名空間 URI

localName string

區域名稱

Returns

OdfElementDefinition

尋找到的元素定義;若未找到則傳回 null

FindPattern(string)

Finds pattern. 根據定義名稱尋找具名的 RELAX NG 模式樹。

public OdfSchemaPatternDefinition? FindPattern(string name)

Parameters

name string

定義名稱

Returns

OdfSchemaPatternDefinition

尋找到的模式定義;若未找到則傳回 null

GetMatchingNameClasses(string, string)

Gets all preserved RELAX NG name classes that match the qualified name. 取得與限定名稱相符的所有保留 RELAX NG 名稱類別。

public IReadOnlyList<OdfSchemaNameClass> GetMatchingNameClasses(string namespaceUri, string localName)

Parameters

namespaceUri string

The namespace URI. / 命名空間 URI。

localName string

The local name. / 區域名稱。

Returns

IReadOnlyList<OdfSchemaNameClass>

The matching name classes. / 符合的名稱類別清單。

IsNameAllowedByNameClasses(string, string)

Returns whether this instance is name allowed by name classes. 傳回保留的扁平名稱類別集是否允許該限定名稱。

public bool IsNameAllowedByNameClasses(string namespaceUri, string localName)

Parameters

namespaceUri string

命名空間 URI

localName string

區域名稱

Returns

bool

若允許該名稱則傳回 true;否則傳回 false

Remarks

此協助方法在不考慮 RELAX NG 模式內容的情況下,評估保留的名稱類別中繼資料:必須至少符合一個非排除的名稱類別,且不得有任何符合的排除名稱類別適用。完整的結構描述驗證仍必須評估周圍的 RELAX NG 模式樹。

MergeWith(OdfSchemaSet)

Short overload of MergeWith that accepts additional; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 additional;其餘可選參數使用預設值並轉呼叫最長 MergeWith 多載。

public OdfSchemaSet MergeWith(OdfSchemaSet additional)

Parameters

additional OdfSchemaSet

Returns

OdfSchemaSet

MergeWith(OdfSchemaSet, bool)

Merges with. 藉由合併此中繼資料與另一個結構描述集,建立新的結構描述集。

public OdfSchemaSet MergeWith(OdfSchemaSet additional, bool overwriteExisting)

Parameters

additional OdfSchemaSet

要合併的額外結構描述集

overwriteExisting bool

是否覆寫已存在的定義

Returns

OdfSchemaSet

合併後的全新 OdfSchemaSet 執行個體