node-zugferd
node-zugferd
F
amount
T
AmountConfig
I
AmountIssue
I
AmountSchema
F
array
V
ARRAY_PATH_WILDCARD
F
arrayAsync
I
ArrayIssue
I
ArraySchema
I
ArraySchemaAsync
F
asArray
F
asArrayAsync
I
AsArrayIssue
I
AsArraySchema
I
AsArraySchemaAsync
T
Awaitable
I
BaseMetadata
I
BaseTransformation
I
BaseTransformationAsync
I
BaseValidation
I
BaseValidationAsync
F
binaryObject
I
BinaryObjectSchema
F
boolean
I
BooleanIssue
I
BooleanSchema
F
code
T
Codelist
T
CodelistStorage
I
CodeSchema
F
collectFieldSchemas
T
DataRelationship
F
date
I
DateConfig
T
DateFormat
T
DateInput
I
DateIssue
T
DateOutput
I
DateSchema
T
DeepPartial
T
DeepReadonly
T
Default
T
DefaultAsync
T
DefaultValue
F
detectDateFormat
V
documentReference
T
FieldSchemaEntry
T
FlattenIntersectOptions
T
FoldIntersectInputs
T
FoldIntersectOutputs
F
formatDate
F
getArrayItemSchema
F
getCodelist
F
getCodelistStore
F
getDefault
F
getMetadata
F
getObjectEntries
F
identifier
T
Identifier
T
IdentifierConfig
I
IdentifierIssue
I
IdentifierSchema
T
InferAmountInput
T
InferAmountOutput
T
InferCodeOutput
T
InferCodeValue
T
InferDefault
T
InferIdentifierInput
T
InferIdentifierOutput
T
InferInput
T
InferIntersectInput
T
InferIntersectOutput
T
InferIssue
T
InferMetadata
T
InferNullishOutput
T
InferObjectInput
T
InferObjectIssue
T
InferObjectOutput
T
InferOutput
T
InferProfileIds
T
InferQuantityInput
T
InferQuantityOutput
F
intersect
F
intersectAsync
I
IntersectIssue
T
IntersectOptions
T
IntersectOptionsAsync
I
IntersectSchema
I
IntersectSchemaAsync
F
isArrayLikeSchema
F
isIntersectSchema
F
isObjectLikeSchema
F
literal
T
Literal
I
LiteralIssue
I
LiteralSchema
T
LiteralString
T
MarkOptional
F
maxLength
I
MaxLengthAction
I
MaxLengthIssue
T
MaybeDeepReadonly
T
MaybePromise
T
MaybeReadonly
T
Merge
T
MergeIntersectInputs
T
MergeIntersectOutputs
T
MergeLocalIntoParent
T
MergeProfileInput
F
metadata
I
MetadataAction
F
minLength
I
MinLengthAction
I
MinLengthIssue
F
nullish
F
nullishAsync
I
NullishSchema
I
NullishSchemaAsync
F
object
F
objectAsync
I
ObjectEntries
I
ObjectEntriesAsync
I
ObjectIssue
T
ObjectKeys
I
ObjectSchema
I
ObjectSchemaAsync
T
OptionalEntrySchema
T
OptionalEntrySchemaAsync
F
parse
F
parseAsync
F
percentage
I
PercentageIssue
I
PercentageSchema
F
pipe
T
PipeAction
T
PipeActionAsync
F
pipeAsync
T
PipeItem
T
PipeItemAsync
T
PluginContext
T
Prettify
T
ProfileContext
F
quantity
T
QuantityConfig
I
QuantitySchema
F
registerCodelist
F
safeParse
F
safeParseAsync
T
SafeParseResult
T
SchemaWithoutPipe
T
SchemaWithPipe
T
SchemaWithPipeAsync
F
sortItems
I
SortItemsAction
I
StringIssue
I
StringSchema
V
text
F
union
F
unionAsync
I
UnionIssue
T
UnionOptions
T
UnionOptionsAsync
I
UnionSchema
I
UnionSchemaAsync
T
UnionToIntersection
F
unitPriceAmount
I
UnitPriceAmountIssue
I
UnitPriceAmountSchema
F
unwrap
F
unwrapSchema
F
walkSchema
T
WalkSchemaOptions
I
XMLBuilder
F
zugferd
T
Zugferd
I
ZugferdCodelistRegistry
T
ZugferdCodelistRegistryIdentifier
T
ZugferdCodelistRegistryValue
T
ZugferdContext
I
ZugferdOptions
I
ZugferdPlugin
I
ZugferdPluginRegistry
T
ZugferdPluginRegistryId
I
ZugferdProfile
T
ZugferdProfileBuildContext
T
ZugferdProfileRulesContext
T
ZugferdRuleId
T
ZugferdWithInfer
@node-zugferd/validator-xsd
@node-zugferd/validator-mustang
@node-zugferd/traffiqx
@node-zugferd/templates
@node-zugferd/pdf-template
@node-zugferd/parser
@node-zugferd/magic-bytes
@node-zugferd/instrumentation
@node-zugferd/docx-template
@node-zugferd/default-template
@node-zugferd/data-types
@node-zugferd/core

XMLBuilder

Represents a wrapper around XML nodes to implement easy to use and chainable document builder methods.

Interface XMLBuilder

interface XMLBuilder

Represents a wrapper around XML nodes to implement easy to use and chainable document builder methods.

Properties

node

Node

Returns the underlying DOM node.

options

XMLBuilderOptions

Gets the options used while creating an XML document.

Methods

att

att(namespace: string | null, name: string, value: string): XMLBuilder

Creates or updates an element attribute.

Parameters

  • namespace: string | null namespace of the attribute
  • name: string attribute name
  • value: string attribute value

Returns XMLBuilder

current element node

att(name: string, value: string): XMLBuilder

Creates or updates an element attribute.

Parameters

  • name: string attribute name
  • value: string attribute value

Returns XMLBuilder

current element node

att(obj: AttributesObject): XMLBuilder

Creates or updates an element attribute.

Parameters

  • obj: AttributesObject a JS object containing element attributes and values

Returns XMLBuilder

current element node

com

com(content: string): XMLBuilder

Creates a new comment node and appends it to the list of child nodes.

Parameters

  • content: string node content

Returns XMLBuilder

current element node

dat

dat(content: string): XMLBuilder

Creates a new CDATA node and appends it to the list of child nodes.

Parameters

  • content: string node content

Returns XMLBuilder

current element node

dec

dec(options: { encoding?: string; standalone?: boolean; version?: "1.0" }): XMLBuilder

Updates XML declaration.

Parameters

  • options: { encoding?: string; standalone?: boolean; version?: "1.0" } declaration options

Returns XMLBuilder

current element node

doc

doc(): XMLBuilder

Returns the document node.

Returns XMLBuilder

dtd

dtd(options?: DTDOptions): XMLBuilder

Creates a new DocType node and inserts it into the document. If the document already contains a DocType node it will be replaced by the new node. Otherwise it will be inserted before the document element node.

Parameters

  • options?: DTDOptions DocType identifiers

Returns XMLBuilder

current element node

each

each(callback: (node: XMLBuilder, index: number, level: number) => void, self?: boolean, recursive?: boolean, thisArg?: any): XMLBuilder

Traverses through the child nodes of a node. callback is called with three arguments: (node, index, level).

Parameters

  • callback: (node: XMLBuilder, index: number, level: number) => void a callback function to apply to each child node
  • self?: boolean whether to visit the current node along with child nodes
  • recursive?: boolean whether to visit all descendant nodes in tree-order or only the immediate child nodes
  • thisArg?: any value to use as this when executing callback

Returns XMLBuilder

ele

ele(namespace: string | null, name: string, attributes?: AttributesObject): XMLBuilder

Creates a new element node and appends it to the list of child nodes.

Parameters

  • namespace: string | null element namespace
  • name: string element name
  • attributes?: AttributesObject a JS object with element attributes

Returns XMLBuilder

the new element node

ele(name: string, attributes?: AttributesObject): XMLBuilder

Creates a new element node and appends it to the list of child nodes.

Parameters

  • name: string element name
  • attributes?: AttributesObject a JS object with element attributes

Returns XMLBuilder

the new element node

ele(obj: ExpandObject): XMLBuilder

Creates new element nodes from the given JS object and appends it to the list of child nodes.

Parameters

  • obj: ExpandObject a JS object representing nodes to insert

Returns XMLBuilder

the last top level element node created

ele(content: string): XMLBuilder

Creates new element nodes from the given XML document string appends it to the list of child nodes.

Parameters

  • content: string an XML document string representing nodes to insert

Returns XMLBuilder

the last top level element node created

end

end(): string

Converts the entire XML document into an XML document string with the default writer options.

Returns string

end(writerOptions: XMLWriterOptions): string

Converts the entire XML document into an XML document string.

Parameters

  • writerOptions: XMLWriterOptions

Returns string

end(writerOptions: JSONWriterOptions): string

Converts the entire XML document into a JSON string.

Parameters

  • writerOptions: JSONWriterOptions

Returns string

end(writerOptions: YAMLWriterOptions): string

Converts the entire XML document into a YAML string.

Parameters

  • writerOptions: YAMLWriterOptions

Returns string

end(writerOptions: ObjectWriterOptions): XMLSerializedAsObject | XMLSerializedAsObjectArray

Converts the entire XML document into its object representation.

Parameters

  • writerOptions: ObjectWriterOptions

Returns XMLSerializedAsObject | XMLSerializedAsObjectArray

end(writerOptions: MapWriterOptions): XMLSerializedAsMap | XMLSerializedAsMapArray

Converts the entire XML document into its object representation using ES6 maps.

Parameters

  • writerOptions: MapWriterOptions

Returns XMLSerializedAsMap | XMLSerializedAsMapArray

every

every(predicate: (node: XMLBuilder, index: number, level: number) => boolean, self?: boolean, recursive?: boolean, thisArg?: any): boolean

Returns true if all child nodes pass the given predicate test. predicate is called with three arguments: (node, index, level).

Parameters

  • predicate: (node: XMLBuilder, index: number, level: number) => boolean a callback function to apply to each child node
  • self?: boolean whether to visit the current node along with child nodes
  • recursive?: boolean whether to visit all descendant nodes in tree-order or only the immediate child nodes
  • thisArg?: any value to use as this when executing predicate

Returns boolean

filter

filter(predicate: (node: XMLBuilder, index: number, level: number) => boolean, self?: boolean, recursive?: boolean, thisArg?: any): XMLBuilder[]

Produces an array of child nodes which pass the given predicate test. predicate is called with three arguments: (node, index, level).

Parameters

  • predicate: (node: XMLBuilder, index: number, level: number) => boolean a callback function to apply to each child node
  • self?: boolean whether to visit the current node along with child nodes
  • recursive?: boolean whether to visit all descendant nodes in tree-order or only the immediate child nodes
  • thisArg?: any value to use as this when executing predicate

Returns XMLBuilder[]

find

find(predicate: (node: XMLBuilder, index: number, level: number) => boolean, self?: boolean, recursive?: boolean, thisArg?: any): XMLBuilder | undefined

Returns the first child node satisfying the given predicate. predicate is called with three arguments: (node, index, level).

Parameters

  • predicate: (node: XMLBuilder, index: number, level: number) => boolean a callback function to apply to each child node
  • self?: boolean whether to visit the current node along with child nodes
  • recursive?: boolean whether to visit all descendant nodes in tree-order or only the immediate child nodes
  • thisArg?: any value to use as this when executing predicate

Returns XMLBuilder | undefined

first

first(): XMLBuilder

Returns the first child node.

Returns XMLBuilder

import

import(node: XMLBuilder): XMLBuilder

Imports a node as a child node of this node. The nodes' descendants and attributes will also be imported.

Parameters

  • node: XMLBuilder the node to import

Note: The node will be cloned before being imported and this clone will be inserted into the document; not the original node.

Note: If the imported node is a document, its document element node will be imported. If the imported node is a document fragment its child nodes will be imported.

Returns XMLBuilder

current element node

ins

ins(target: string, content?: string): XMLBuilder

Creates a new processing instruction node and appends it to the list of child nodes.

Parameters

  • target: string instruction target
  • content?: string node content

Returns XMLBuilder

current element node

ins(target: PIObject): XMLBuilder

Creates new processing instruction nodes by expanding the given object and appends them to the list of child nodes.

Parameters

  • target: PIObject

Returns XMLBuilder

current element node

last

last(): XMLBuilder

Returns the last child node.

Returns XMLBuilder

map

map<T>(callback: (node: XMLBuilder, index: number, level: number) => T, self?: boolean, recursive?: boolean, thisArg?: any): T[]

Produces an array of values by transforming each child node with the given callback function. callback is called with three arguments: (node, index, level).

Parameters

  • callback: (node: XMLBuilder, index: number, level: number) => T a callback function to apply to each child node
  • self?: boolean whether to visit the current node along with child nodes
  • recursive?: boolean whether to visit all descendant nodes in tree-order or only the immediate child nodes
  • thisArg?: any value to use as this when executing callback

Returns T[]

next

next(): XMLBuilder

Returns the next sibling node.

Returns XMLBuilder

prev

prev(): XMLBuilder

Returns the previous sibling node.

Returns XMLBuilder

reduce

reduce<T>(callback: (value: T, node: XMLBuilder, index: number, level: number) => T, initialValue: T, self?: boolean, recursive?: boolean, thisArg?: any): T

Reduces child nodes into a single value by applying the given callback function. callback is called with four arguments: (value, node, index, level).

Parameters

  • callback: (value: T, node: XMLBuilder, index: number, level: number) => T a callback function to apply to each child node
  • initialValue: T initial value of the iteration
  • self?: boolean whether to visit the current node along with child nodes
  • recursive?: boolean whether to visit all descendant nodes in tree-order or only the immediate child nodes
  • thisArg?: any value to use as this when executing callback

Returns T

remove

remove(): XMLBuilder

Removes this node from the XML document.

Returns XMLBuilder

parent element node

removeAtt

removeAtt(name: string): XMLBuilder

Removes an attribute.

Parameters

  • name: string attribute name

Returns XMLBuilder

current element node

removeAtt(names: string[]): XMLBuilder

Removes a list of attributes.

Parameters

  • names: string[] an array with attribute names

Returns XMLBuilder

current element node

removeAtt(namespace: string | null, name: string): XMLBuilder

Removes an attribute.

Parameters

  • namespace: string | null namespace of the attribute to remove
  • name: string attribute name

Returns XMLBuilder

current element node

removeAtt(namespace: string | null, names: string[]): XMLBuilder

Removes a list of attributes.

Parameters

  • namespace: string | null namespace of the attributes to remove
  • names: string[] an array with attribute names

Returns XMLBuilder

current element node

root

root(): XMLBuilder

Returns the root element node.

Returns XMLBuilder

set

set(builderOptions: Partial<XMLBuilderOptions>): XMLBuilder

Sets builder options.

Parameters

  • builderOptions: Partial<XMLBuilderOptions>

Returns XMLBuilder

current element node

some

some(predicate: (node: XMLBuilder, index: number, level: number) => boolean, self?: boolean, recursive?: boolean, thisArg?: any): boolean

Returns true if any of the child nodes pass the given predicate test. predicate is called with three arguments: (node, index, level).

Parameters

  • predicate: (node: XMLBuilder, index: number, level: number) => boolean a callback function to apply to each child node
  • self?: boolean whether to visit the current node along with child nodes
  • recursive?: boolean whether to visit all descendant nodes in tree-order or only the immediate child nodes
  • thisArg?: any value to use as this when executing predicate

Returns boolean

toArray

toArray(self?: boolean, recursive?: boolean): XMLBuilder[]

Produces an array of child nodes.

Parameters

  • self?: boolean whether to visit the current node along with child nodes
  • recursive?: boolean whether to visit all descendant nodes in tree-order or only the immediate child nodes

Returns XMLBuilder[]

toObject

toObject(writerOptions?: ObjectWriterOptions): XMLSerializedAsObject | XMLSerializedAsObjectArray

Converts the node into its object representation.

Parameters

  • writerOptions?: ObjectWriterOptions

Returns XMLSerializedAsObject | XMLSerializedAsObjectArray

toObject(writerOptions: MapWriterOptions): XMLSerializedAsMap | XMLSerializedAsMapArray

Converts the node into its object representation using ES6 maps.

Parameters

  • writerOptions: MapWriterOptions

Returns XMLSerializedAsMap | XMLSerializedAsMapArray

toString

toString(writerOptions?: XMLWriterOptions): string

Converts the node into an XML string.

Parameters

  • writerOptions?: XMLWriterOptions

Returns string

toString(writerOptions: JSONWriterOptions): string

Converts the node into a JSON string.

Parameters

  • writerOptions: JSONWriterOptions

Returns string

toString(writerOptions: YAMLWriterOptions): string

Converts the node into a YAML string.

Parameters

  • writerOptions: YAMLWriterOptions

Returns string

txt

txt(content: string): XMLBuilder

Creates a new text node and appends it to the list of child nodes.

Parameters

  • content: string node content

Returns XMLBuilder

current element node

up

up(): XMLBuilder

Returns the parent node.

Returns XMLBuilder


llms.txt
I
UnitPriceAmountSchema

I
ZugferdCodelistRegistry

Edit on GitHubPrivacyImprint