Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/docxml/src/classes/XmlFile.ts>XmlFile

TypeScript (component) library for building and parsing a DOCX file
Go to Latest
class XmlFile
import { XmlFile } from "https://deno.land/x/docxml@5.11.0/src/classes/XmlFile.ts";

Constructors

new
protected
XmlFile(location: string)

Properties

readonly
contentType: FileMime
readonly
location: string

Methods

protected
toNode(): Document | Promise<Document>

Create a (slimdom) Document DOM for this XML file. This is useful for serializing it to string and writing to a ZIP/DOCX archive later.

deprecated
$$$toNode()
addToArchive(archive: Archive): Promise<void>

Add all related files to the given archive.

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.

Let a file tell the system when it is effectively empty, so it can be omitted from the archive.

Static Properties

readonly
contentType: FileMime

Static Methods

fromArchive(_archive: Archive, location: string): Promise<XmlFile>

Promise a new JS instance of this file based on the given archive.