Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

DocBookDocument

OfficeIMO.DocBook

Namespace
OfficeIMO.DocBook
Assembly
OfficeIMO.DocBook
Source revision
ba882f6b0d07 with working tree changes
Modifiers
sealed

Source-preserving DocBook 4/5 document with a bounded typed common-structure API and extension access.

Inheritance

  • object
  • DocBookDocument

Usage

Explore 6 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Methods

public DocBookNode AddParagraph(string text) #

Adds a top-level paragraph, creating a chapter container first for a book.

Parameters

text string required
public DocBookNode AddSection(string title) #

Adds a top-level section, creating a chapter container first for a book.

Parameters

title string required
public static DocBookDocument CreateArticle(DocBookProfile profile = DocBook52) #

Creates an article using the exact selected writer profile.

Parameters

profile OfficeIMO.DocBook.DocBookProfile = DocBook52 optional
public static DocBookDocument CreateBook(DocBookProfile profile = DocBook52) #

Creates a book using the exact selected writer profile.

Parameters

profile OfficeIMO.DocBook.DocBookProfile = DocBook52 optional
public static DocBookConversionResult<DocBookDocument> FromOfficeDocumentModel(OfficeDocumentModel model, DocBookDocumentKind? kind = null, DocBookProfile? profile = null, DocBookConversionOptions? options = null) #

Creates an article or book from the shared recursive common structure.

Parameters

model OfficeIMO.OfficeDocumentModel required
kind OfficeIMO.DocBook.DocBookDocumentKind? = null optional
profile OfficeIMO.DocBook.DocBookProfile? = null optional
options OfficeIMO.DocBook.DocBookConversionOptions? = null optional
Load 2 overloads
public static DocBookDocument Load(string path, DocBookLoadOptions? options = null, CancellationToken cancellationToken = default) #

Loads a DocBook file.

Parameters

path string required
options OfficeIMO.DocBook.DocBookLoadOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional
public static DocBookDocument Load(Stream stream, DocBookLoadOptions? options = null, CancellationToken cancellationToken = default) #

Loads DocBook from a caller-owned stream while preserving seekable position.

Parameters

stream System.IO.Stream required
options OfficeIMO.DocBook.DocBookLoadOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional
public static async Task<DocBookDocument> LoadAsync(Stream stream, DocBookLoadOptions? options = null, CancellationToken cancellationToken = default) #

Loads DocBook asynchronously from a caller-owned stream.

Parameters

stream System.IO.Stream required
options OfficeIMO.DocBook.DocBookLoadOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<DocBookDocument>
public static DocBookDocument Parse(string text, DocBookLoadOptions? options = null, CancellationToken cancellationToken = default) #

Parses DocBook text using secure, bounded XML settings.

Parameters

text string required
options OfficeIMO.DocBook.DocBookLoadOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional
Save 3 overloads
public void Save(Stream destination, DocBookSaveOptions? options = null) #

Writes to a caller-owned stream.

Parameters

destination System.IO.Stream required
options OfficeIMO.DocBook.DocBookSaveOptions? = null optional
public void Save(DocBookSaveOptions? options = null) #

Saves to the associated path, failing when no destination is associated.

Parameters

options OfficeIMO.DocBook.DocBookSaveOptions? = null optional
public void Save(string path, DocBookSaveOptions? options = null) #

Atomically saves native output and associates the successfully written path.

Parameters

path string required
options OfficeIMO.DocBook.DocBookSaveOptions? = null optional
SaveAsync 3 overloads
public Task SaveAsync(Stream destination, DocBookSaveOptions? options = null, CancellationToken cancellationToken = default) #

Writes asynchronously to a caller-owned stream.

Parameters

destination System.IO.Stream required
options OfficeIMO.DocBook.DocBookSaveOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task
public Task SaveAsync(DocBookSaveOptions? options = null, CancellationToken cancellationToken = default) #

Asynchronously saves to the associated path.

Parameters

options OfficeIMO.DocBook.DocBookSaveOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task
public async Task SaveAsync(string path, DocBookSaveOptions? options = null, CancellationToken cancellationToken = default) #

Atomically saves native output asynchronously and associates the successfully written path.

Parameters

path string required
options OfficeIMO.DocBook.DocBookSaveOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task
public byte[] ToBytes(DocBookSaveOptions? options = null) #

Serializes native bytes, preserving an unchanged source when requested.

Parameters

options OfficeIMO.DocBook.DocBookSaveOptions? = null optional

Returns

byte[]
public string ToDocBook(DocBookSaveOptions? options = null) #

Returns DocBook XML, preserving the exact unchanged source by default.

Parameters

options OfficeIMO.DocBook.DocBookSaveOptions? = null optional

Returns

string
public DocBookConversionResult<OfficeDocumentModel> ToOfficeDocumentModel(string? sourcePath = null, DocBookConversionOptions? options = null, CancellationToken cancellationToken = default) #

Converts the typed common structure to the shared recursive document model.

Parameters

sourcePath string? = null optional
options OfficeIMO.DocBook.DocBookConversionOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional
public DocBookValidationResult Validate(DocBookValidationOptions? options = null, CancellationToken cancellationToken = default) #

Validates the bounded OfficeIMO common-structure profile. The returned result explicitly does not represent a complete external DTD, RELAX NG, Schematron, XInclude, assembly, or vocabulary-extension validation run.

Parameters

options OfficeIMO.DocBook.DocBookValidationOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Properties

public string? FilePath { get; } #

Gets the associated path, or null for an in-memory document.

public DocBookProfile Profile { get; } #

Exact writer and bounded-validation profile selected for this document.

public DocBookSchemaProfile SchemaProfile { get; } #

Exact official schema identifiers associated with DocBookDocument.Profile.

public DocBookDocumentKind Kind { get; } #

Document root kind.

public bool IsModified { get; } #

True after a typed mutation or while the backing XML differs from its loaded form.

public DocBookNode Root { get; } #

Root element as a typed common node.

public XDocument Xml { get; } #

Underlying XML for extension inspection and advanced lossless editing.

public string? Title { get; set; } #

Document title from the root metadata/title.