Skip to main content
Module

x/docxml/mod.ts>DocumentXml

An experimental Deno tool to transform XML to DOCX with a little XPath- and component based configuration
Go to Latest
class DocumentXml
extends XmlFile
import { DocumentXml } from "https://deno.land/x/docxml@5.0.0/mod.ts";

Constructors

new
DocumentXml(location: string, relationships?)

Properties

readonly
children: Promise<OfficeDocumentChild[]>

The components normalized from #root, which is potentially arrayed, promised, array promised etc.

readonly
comments: Comments

The API representing "comments.xml" and all the comments associated with this document.

readonly
relationships: Relationships
readonly
settings: Settings

The API representing "settings.xml" and all the settings associated with this document.

readonly
styles: Styles

The API representing "styles.xml" and all the text/paragraph/table styles associated with this document.

Methods

protected
toNode(): Promise<Document>

Get all XmlFile instances related to this one, including self. This helps the system serialize itself back to DOCX fullly. Probably not useful for consumers of the library.

By default only returns the instance itself but no other related instances.

set(root: OfficeDocumentRoot): void

Set the contents of the document

Static Methods

fromArchive(archive: Archive, location: string): Promise<OfficeDocument>

Instantiate this class by looking at the DOCX XML for it.