Class: DomDataAdapter
Defined in: lang-xquery/src/language/data-adapter.ts:94
XQuery data adapter based on DOM. It can also access JavaScript object attributes with the attribute axis.
Implements
XQueryDataAdapter<Node>
Constructors
Constructor
new DomDataAdapter(
doc):DomDataAdapter
Defined in: lang-xquery/src/language/data-adapter.ts:98
Parameters
| Parameter | Type | Description |
|---|---|---|
doc | Document | The DOM Document used for all node creation operations. |
Returns
DomDataAdapter
Properties
doc
protecteddoc:Document
Defined in: lang-xquery/src/language/data-adapter.ts:98
The DOM Document used for all node creation operations.
treeStep
treeStep: (
test,axis) => (node) =>Node[]
Defined in: lang-xquery/src/language/data-adapter.ts:121
Create an XPath step function.
Creates a DOM-based axis step function that traverses axis and filters
nodes matching test.
Parameters
| Parameter | Type |
|---|---|
test | ASTItemType |
axis | AxisType |
Returns
(node) => Node[]
Throws
When test.kind names an item kind without a
DOM nodeType mapping.
Param
test
The item test to apply.
Param
axis
The axis to use.
Implementation of
Methods
addAttribute()
addAttribute(
el,attr):void
Defined in: lang-xquery/src/language/data-adapter.ts:194
Add an attribute to an element.
Parameters
| Parameter | Type | Description |
|---|---|---|
el | Element | The element to add the attribute to. |
attr | Attr | The attribute to add. |
Returns
void
Implementation of
XQueryDataAdapter.addAttribute
appendItem()
protectedappendItem(node,item):void
Defined in: lang-xquery/src/language/data-adapter.ts:184
Appends item to node: attributes are set via setAttributeNodeNS,
other Node instances are appended as children, and primitives are
serialized to text nodes.
Parameters
| Parameter | Type |
|---|---|
node | Node |
item | unknown |
Returns
void
atomize()
atomize(
value):unknown
Defined in: lang-xquery/src/language/data-adapter.ts:110
Atomize a value.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | unknown | The value to atomize. |
Returns
unknown
Implementation of
cloneNode()
cloneNode(
node):Node
Defined in: lang-xquery/src/language/data-adapter.ts:106
Create deep copy of a node.
Parameters
| Parameter | Type |
|---|---|
node | Node |
Returns
Node
Implementation of
createAttribute()
createAttribute(
ns,qname,content):Attr
Defined in: lang-xquery/src/language/data-adapter.ts:132
Create an attribute node.
Parameters
| Parameter | Type | Description |
|---|---|---|
ns | string | The namespace URI. |
qname | string | The attribute name. |
content | string | The attribute value. |
Returns
Attr
Implementation of
XQueryDataAdapter.createAttribute
createComment()
createComment(
content):Comment
Defined in: lang-xquery/src/language/data-adapter.ts:139
Create a comment node.
Parameters
| Parameter | Type | Description |
|---|---|---|
content | string | The comment content. |
Returns
Comment
Implementation of
XQueryDataAdapter.createComment
createDocument()
createDocument(
ns,qname,content):Element|Document
Defined in: lang-xquery/src/language/data-adapter.ts:143
Create a document node.
Parameters
| Parameter | Type | Description |
|---|---|---|
ns | string | The namespace URI. |
qname | string | The document name. |
content | unknown[] | The child nodes. |
Returns
Element | Document
Implementation of
XQueryDataAdapter.createDocument
createElement()
createElement(
ns,qname,content):Element
Defined in: lang-xquery/src/language/data-adapter.ts:123
Create an element node.
Parameters
| Parameter | Type | Description |
|---|---|---|
ns | string | The namespace URI. |
qname | string | The element name. |
content | unknown[] | The child nodes. |
Returns
Element
Implementation of
XQueryDataAdapter.createElement
createNS()
createNS(
name,content):Attr
Defined in: lang-xquery/src/language/data-adapter.ts:155
Create a namespace node.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | The namespace prefix. |
content | string | The namespace URI. |
Returns
Attr
Implementation of
createProcInstr()
createProcInstr(
name,content):ProcessingInstruction
Defined in: lang-xquery/src/language/data-adapter.ts:168
Create a processing instruction node.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | The processing instruction name. |
content | string | The processing instruction content. |
Returns
ProcessingInstruction
Implementation of
XQueryDataAdapter.createProcInstr
createText()
createText(
content):Text
Defined in: lang-xquery/src/language/data-adapter.ts:164
Create a text node.
Parameters
| Parameter | Type | Description |
|---|---|---|
content | string | The text content. |
Returns
Text
Implementation of
isNode()
isNode(
node):node is Node
Defined in: lang-xquery/src/language/data-adapter.ts:102
Is the value a Node?
Parameters
| Parameter | Type |
|---|---|
node | unknown |
Returns
node is Node
Implementation of
lookupNSUri()
lookupNSUri(
el,prefix):string
Defined in: lang-xquery/src/language/data-adapter.ts:175
Lookup the namespace URI for a given element.
Parameters
| Parameter | Type | Description |
|---|---|---|
el | Node | The element to look up the URI for. |
prefix | string | The namespace prefix. |
Returns
string
Implementation of
lookupPrefix()
lookupPrefix(
el,ns):string
Defined in: lang-xquery/src/language/data-adapter.ts:172
Lookup the namespace prefix for a given element.
Parameters
| Parameter | Type | Description |
|---|---|---|
el | Element | Document | The element to look up the prefix for. |
ns | string | The namespace URI. |
Returns
string