DocBookDocument
OfficeIMO.DocBook
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.
Returned or exposed by 6
- Method DocBookDocument.CreateArticle
- Method DocBookDocument.CreateBook
- Method DocBookDocument.FromOfficeDocumentModel
- Method DocBookDocument.Load
- Method DocBookDocument.LoadAsync
- Method DocBookDocument.Parse
Methods
public DocBookNode AddParagraph(string text) #Adds a top-level paragraph, creating a chapter container first for a book.
Parameters
- text string
Returns
DocBookNodepublic DocBookNode AddSection(string title) #Adds a top-level section, creating a chapter container first for a book.
Parameters
- title string
Returns
DocBookNodepublic static DocBookDocument CreateArticle(DocBookProfile profile = DocBook52) #Creates an article using the exact selected writer profile.
Parameters
- profile OfficeIMO.DocBook.DocBookProfile = DocBook52
Returns
DocBookDocumentpublic static DocBookDocument CreateBook(DocBookProfile profile = DocBook52) #Creates a book using the exact selected writer profile.
Parameters
- profile OfficeIMO.DocBook.DocBookProfile = DocBook52
Returns
DocBookDocumentpublic 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
- kind OfficeIMO.DocBook.DocBookDocumentKind? = null
- profile OfficeIMO.DocBook.DocBookProfile? = null
- options OfficeIMO.DocBook.DocBookConversionOptions? = null
public static DocBookDocument Load(string path, DocBookLoadOptions? options = null, CancellationToken cancellationToken = default) #Loads a DocBook file.
Parameters
- path string
- options OfficeIMO.DocBook.DocBookLoadOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
DocBookDocumentpublic 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
- options OfficeIMO.DocBook.DocBookLoadOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
DocBookDocumentpublic 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
- options OfficeIMO.DocBook.DocBookLoadOptions? = null
- cancellationToken System.Threading.CancellationToken = default
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
- options OfficeIMO.DocBook.DocBookLoadOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
DocBookDocumentpublic void Save(Stream destination, DocBookSaveOptions? options = null) #Writes to a caller-owned stream.
Parameters
- destination System.IO.Stream
- options OfficeIMO.DocBook.DocBookSaveOptions? = null
public void Save(DocBookSaveOptions? options = null) #Saves to the associated path, failing when no destination is associated.
Parameters
- options OfficeIMO.DocBook.DocBookSaveOptions? = null
public void Save(string path, DocBookSaveOptions? options = null) #Atomically saves native output and associates the successfully written path.
Parameters
- path string
- options OfficeIMO.DocBook.DocBookSaveOptions? = null
public Task SaveAsync(Stream destination, DocBookSaveOptions? options = null, CancellationToken cancellationToken = default) #Writes asynchronously to a caller-owned stream.
Parameters
- destination System.IO.Stream
- options OfficeIMO.DocBook.DocBookSaveOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Taskpublic Task SaveAsync(DocBookSaveOptions? options = null, CancellationToken cancellationToken = default) #Asynchronously saves to the associated path.
Parameters
- options OfficeIMO.DocBook.DocBookSaveOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Taskpublic 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
- options OfficeIMO.DocBook.DocBookSaveOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Taskpublic byte[] ToBytes(DocBookSaveOptions? options = null) #Serializes native bytes, preserving an unchanged source when requested.
Parameters
- options OfficeIMO.DocBook.DocBookSaveOptions? = null
Returns
byte[]public string ToDocBook(DocBookSaveOptions? options = null) #Returns DocBook XML, preserving the exact unchanged source by default.
Parameters
- options OfficeIMO.DocBook.DocBookSaveOptions? = null
Returns
stringpublic 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
- options OfficeIMO.DocBook.DocBookConversionOptions? = null
- cancellationToken System.Threading.CancellationToken = default
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
- cancellationToken System.Threading.CancellationToken = default
Returns
DocBookValidationResultInherited Methods
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 bool IsModified { get; } #True after a typed mutation or while the backing XML differs from its loaded form.
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.