Skip to main content

Interface: XQueryDataAdapter<NodeType>

Defined in: lang-xquery/src/language/data-adapter.ts:9

Data adapter for the XQuery language.

Type Parameters​

Type ParameterDefault type
NodeTypeany

Methods​

addAttribute()​

addAttribute(el, attr): void

Defined in: lang-xquery/src/language/data-adapter.ts:70

Add an attribute to an element.

Parameters​

ParameterTypeDescription
elNodeTypeThe element to add the attribute to.
attrNodeTypeThe attribute to add.

Returns​

void


atomize()​

atomize(value): unknown

Defined in: lang-xquery/src/language/data-adapter.ts:87

Atomize a value.

Parameters​

ParameterTypeDescription
valueunknownThe value to atomize.

Returns​

unknown


cloneNode()​

cloneNode(node): NodeType

Defined in: lang-xquery/src/language/data-adapter.ts:14

Create deep copy of a node.

Parameters​

ParameterType
nodeNodeType

Returns​

NodeType


createAttribute()​

createAttribute(ns, qname, content): NodeType

Defined in: lang-xquery/src/language/data-adapter.ts:35

Create an attribute node.

Parameters​

ParameterTypeDescription
nsstringThe namespace URI.
qnamestringThe attribute name.
contentstringThe attribute value.

Returns​

NodeType


createComment()​

createComment(content): NodeType

Defined in: lang-xquery/src/language/data-adapter.ts:40

Create a comment node.

Parameters​

ParameterTypeDescription
contentstringThe comment content.

Returns​

NodeType


createDocument()​

createDocument(ns, qname, content): NodeType

Defined in: lang-xquery/src/language/data-adapter.ts:47

Create a document node.

Parameters​

ParameterTypeDescription
nsstringThe namespace URI.
qnamestringThe document name.
contentunknown[]The child nodes.

Returns​

NodeType


createElement()​

createElement(ns, qname, content): NodeType

Defined in: lang-xquery/src/language/data-adapter.ts:28

Create an element node.

Parameters​

ParameterTypeDescription
nsstringThe namespace URI.
qnamestringThe element name.
contentunknown[]The child nodes.

Returns​

NodeType


createNS()​

createNS(name, content): NodeType

Defined in: lang-xquery/src/language/data-adapter.ts:53

Create a namespace node.

Parameters​

ParameterTypeDescription
namestringThe namespace prefix.
contentstringThe namespace URI.

Returns​

NodeType


createProcInstr()​

createProcInstr(name, content): NodeType

Defined in: lang-xquery/src/language/data-adapter.ts:64

Create a processing instruction node.

Parameters​

ParameterTypeDescription
namestringThe processing instruction name.
contentstringThe processing instruction content.

Returns​

NodeType


createText()​

createText(content): NodeType

Defined in: lang-xquery/src/language/data-adapter.ts:58

Create a text node.

Parameters​

ParameterTypeDescription
contentstringThe text content.

Returns​

NodeType


isNode()​

isNode(node): node is NodeType

Defined in: lang-xquery/src/language/data-adapter.ts:11

Is the value a Node?

Parameters​

ParameterType
nodeunknown

Returns​

node is NodeType


lookupNSUri()​

lookupNSUri(el, prefix): string

Defined in: lang-xquery/src/language/data-adapter.ts:82

Lookup the namespace URI for a given element.

Parameters​

ParameterTypeDescription
elNodeTypeThe element to look up the URI for.
prefixstringThe namespace prefix.

Returns​

string


lookupPrefix()​

lookupPrefix(el, ns): string

Defined in: lang-xquery/src/language/data-adapter.ts:76

Lookup the namespace prefix for a given element.

Parameters​

ParameterTypeDescription
elNodeTypeThe element to look up the prefix for.
nsstringThe namespace URI.

Returns​

string


treeStep()​

treeStep(test, axis): (node) => NodeType[]

Defined in: lang-xquery/src/language/data-adapter.ts:21

Create an XPath step function.

Parameters​

ParameterTypeDescription
testASTItemTypeThe item test to apply.
axisAxisTypeThe axis to use.

Returns​

(node) => NodeType[]