ajdom.c


Function ajDomNodeListGetLen

Return the length of a DOM node list

Synopsis

Prototype
ajint ajDomNodeListGetLen (
      const AjPDomNodeList list
);

TypeNameRead/WriteDescription
const AjPDomNodeListlistInputnode list
ajint RETURNLength (-1 if error)

Input
list:(Input)node list
Returns
ajint:Length (-1 if error)

Description

Return the length of a DOM node list

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomNodeListAppend

Append a child node to a DOM node list

Synopsis

Prototype
AjPDomNodeEntry ajDomNodeListAppend (
      AjPDomNodeList list,
      AjPDomNode child
);

TypeNameRead/WriteDescription
AjPDomNodeListlistOutputnode list
AjPDomNodechildModifychild
AjPDomNodeEntry RETURNNode list child entry created

Output
list:(Output)node list
Input & Output
child:(Modify)child
Returns
AjPDomNodeEntry:Node list child entry created

Description

Append a child node to a DOM node list

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomNodeAppendChild

Appends an extra child at the end of the child nodes list of a node. If extrachild is already in the list, it is first removed.

Synopsis

Prototype
AjPDomNode ajDomNodeAppendChild (
      AjPDomNode node,
      AjPDomNode extrachild
);

TypeNameRead/WriteDescription
AjPDomNodenodeOutputnode
AjPDomNodeextrachildModifyextra child
AjPDomNode RETURNPointer to extrachild or NULL if error

Output
node:(Output)node
Input & Output
extrachild:(Modify)extra child
Returns
AjPDomNode:Pointer to extrachild or NULL if error

Description

Appends an extra child at the end of the child nodes list of a node. If extrachild is already in the list, it is first removed.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomRemoveChild

Removes a child node from a list of children

Synopsis

Prototype
AjPDomNode ajDomRemoveChild (
      AjPDomNode node,
      AjPDomNode child
);

TypeNameRead/WriteDescription
AjPDomNodenodeOutputnode
AjPDomNodechildModifychild to remove
AjPDomNode RETURNchild removed

Output
node:(Output)node
Input & Output
child:(Modify)child to remove
Returns
AjPDomNode:child removed

Description

Removes a child node from a list of children

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomNodeListExists

Check whether a child exists in a node list

Synopsis

Prototype
AjBool ajDomNodeListExists (
      AjPDomNodeList list,
      const AjPDomNode child
);

TypeNameRead/WriteDescription
AjPDomNodeListlistModifylist
const AjPDomNodechildInputchild
AjBool RETURNtrue if child is in the list

Input
child:(Input)child
Input & Output
list:(Modify)list
Returns
AjBool:true if child is in the list

Description

Check whether a child exists in a node list

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomNodeListRemove

Remove a child from a node list

Synopsis

Prototype
AjPDomNodeEntry ajDomNodeListRemove (
      AjPDomNodeList list,
      AjPDomNode child
);

TypeNameRead/WriteDescription
AjPDomNodeListlistOutputlist
AjPDomNodechildModifychild
AjPDomNodeEntry RETURNchild removed or NULL if not found

Output
list:(Output)list
Input & Output
child:(Modify)child
Returns
AjPDomNodeEntry:child removed or NULL if not found

Description

Remove a child from a node list

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomDocumentDestroyNode

Frees a node and its children

Synopsis

Prototype
void ajDomDocumentDestroyNode (
      AjPDomDocument doc,
      AjPDomNode node
);

TypeNameRead/WriteDescription
AjPDomDocumentdocOutputdocument
AjPDomNodenodeOutputnode
void RETURN

Output
doc:(Output)document
node:(Output)node
Returns
void:No return value

Description

Frees a node and its children

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomDocumentDestroyNodeList

Frees a node list

Synopsis

Prototype
void ajDomDocumentDestroyNodeList (
      AjPDomDocument doc,
      AjPDomNodeList list,
      AjBool donodes
);

TypeNameRead/WriteDescription
AjPDomDocumentdocOutputdocument
AjPDomNodeListlistOutputlist
AjBooldonodesInputfree nodes as well if true
void RETURN

Input
donodes:(Input)free nodes as well if true
Output
doc:(Output)document
list:(Output)list
Returns
void:No return value

Description

Frees a node list

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomCreateNodeList

Create a node list

Synopsis

Prototype
AjPDomNodeList ajDomCreateNodeList (
      AjPDomDocument doc
);

TypeNameRead/WriteDescription
AjPDomDocumentdocModifydocument
AjPDomNodeList RETURNnew list

Input & Output
doc:(Modify)document
Returns
AjPDomNodeList:new list

Description

Create a node list

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomDocumentCreateNode

General document node creation

Synopsis

Prototype
AjPDomNode ajDomDocumentCreateNode (
      AjPDomDocument doc,
      ajuint nodetype
);

TypeNameRead/WriteDescription
AjPDomDocumentdocModifydocument
ajuintnodetypeInputtype of node to create
AjPDomNode RETURNnew node

Input
nodetype:(Input)type of node to create
Input & Output
doc:(Modify)document
Returns
AjPDomNode:new node

Description

General document node creation

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomImplementationCreateDocumentType

Creates an empty DocumentType node into which entities/notations (etc) can be placed

Synopsis

Prototype
AjPDomDocumentType ajDomImplementationCreateDocumentType (
      const AjPStr qualname,
      const AjPStr publicid,
      const AjPStr systemid
);

TypeNameRead/WriteDescription
const AjPStrqualnameInputqualified name
const AjPStrpublicidInputpublic id
const AjPStrsystemidInputsystemid
AjPDomDocumentType RETURNnew DocumentType node

Input
qualname:(Input)qualified name
publicid:(Input)public id
systemid:(Input)systemid
Returns
AjPDomDocumentType:new DocumentType node

Description

Creates an empty DocumentType node into which entities/notations (etc) can be placed

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomImplementationCreateDocumentTypeC

Creates an empty DocumentType node into which entities/notations (etc) can be placed

Synopsis

Prototype
AjPDomDocumentType ajDomImplementationCreateDocumentTypeC (
      const char* qualname,
      const char* publicid,
      const char* systemid
);

TypeNameRead/WriteDescription
const char*qualnameInputqualified name
const char*publicidInputpublic id
const char*systemidInputsystemid
AjPDomDocumentType RETURNnew DocumentType node

Input
qualname:(Input)qualified name
publicid:(Input)public id
systemid:(Input)systemid
Returns
AjPDomDocumentType:new DocumentType node

Description

Creates an empty DocumentType node into which entities/notations (etc) can be placed

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomImplementationCreateDocument

Creates an XML Document object of the specified type with its document element.

Synopsis

Prototype
AjPDomDocument ajDomImplementationCreateDocument (
      const AjPStr uri,
      const AjPStr qualname,
      AjPDomDocumentType doctype
);

TypeNameRead/WriteDescription
const AjPStruriInputuri (not implemented. Pass NULL)
const AjPStrqualnameInputqualified name
AjPDomDocumentTypedoctypeModifydoctype
AjPDomDocument RETURNnew document

Input
uri:(Input)uri (not implemented. Pass NULL)
qualname:(Input)qualified name
Input & Output
doctype:(Modify)doctype
Returns
AjPDomDocument:new document

Description

Creates an XML Document object of the specified type with its document element.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomImplementationCreateDocumentC

Creates an XML Document object of the specified type with its document element.

Synopsis

Prototype
AjPDomDocument ajDomImplementationCreateDocumentC (
      const char* uri,
      const char* qualname,
      AjPDomDocumentType doctype
);

TypeNameRead/WriteDescription
const char*uriInputuri (not implemented. Pass NULL)
const char*qualnameInputqualified name
AjPDomDocumentTypedoctypeModifydoctype
AjPDomDocument RETURNnew document

Input
uri:(Input)uri (not implemented. Pass NULL)
qualname:(Input)qualified name
Input & Output
doctype:(Modify)doctype
Returns
AjPDomDocument:new document

Description

Creates an XML Document object of the specified type with its document element.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomNodeMapGetItem

Returns the named node from a node map

Synopsis

Prototype
AjPDomNode ajDomNodeMapGetItem (
      const AjPDomNodeMap map,
      const AjPStr name
);

TypeNameRead/WriteDescription
const AjPDomNodeMapmapInputmap
const AjPStrnameInputname
AjPDomNode RETURNnode

Input
map:(Input)map
name:(Input)name
Returns
AjPDomNode:node

Description

Returns the named node from a node map

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomNodeMapGetItemC

Returns the named node from a node map

Synopsis

Prototype
AjPDomNode ajDomNodeMapGetItemC (
      const AjPDomNodeMap map,
      const char* name
);

TypeNameRead/WriteDescription
const AjPDomNodeMapmapInputmap
const char*nameInputname
AjPDomNode RETURNnode

Input
map:(Input)map
name:(Input)name
Returns
AjPDomNode:node

Description

Returns the named node from a node map

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomElementGetAttribute

Returns the value of a named attribute

Synopsis

Prototype
AjPStr ajDomElementGetAttribute (
      const AjPDomElement element,
      const AjPStr name
);

TypeNameRead/WriteDescription
const AjPDomElementelementInputelement
const AjPStrnameInputname
AjPStr RETURNvalue or empty string

Input
element:(Input)element
name:(Input)name
Returns
AjPStr:value or empty string

Description

Returns the value of a named attribute

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomElementGetAttributeC

Returns the value of a named attribute

Synopsis

Prototype
AjPStr ajDomElementGetAttributeC (
      const AjPDomElement element,
      const char* name
);

TypeNameRead/WriteDescription
const AjPDomElementelementInputelement
const char*nameInputname
AjPStr RETURNvalue or empty string

Input
element:(Input)element
name:(Input)name
Returns
AjPStr:value or empty string

Description

Returns the value of a named attribute

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomNodeMapSetItem

Enter arg into the node map using name as the key. If a node with the same name already exists in the map it will be replaced with the new node and returned. The replaced node should usually be freed with DestroyNode.

Synopsis

Prototype
AjPDomNode ajDomNodeMapSetItem (
      AjPDomNodeMap map,
      AjPDomNode arg
);

TypeNameRead/WriteDescription
AjPDomNodeMapmapModifymap
AjPDomNodeargModifyarg
AjPDomNode RETURNreplaced node or NULL

Input & Output
map:(Modify)map
arg:(Modify)arg
Returns
AjPDomNode:replaced node or NULL

Description

Enter arg into the node map using name as the key. If a node with the same name already exists in the map it will be replaced with the new node and returned. The replaced node should usually be freed with DestroyNode.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomNodeMapRemoveItem

Removes and returns item from a map

Synopsis

Prototype
AjPDomNode ajDomNodeMapRemoveItem (
      AjPDomNodeMap map,
      const AjPStr name
);

TypeNameRead/WriteDescription
AjPDomNodeMapmapModifymap
const AjPStrnameInputname
AjPDomNode RETURNremoved node or NULL

Input
name:(Input)name
Input & Output
map:(Modify)map
Returns
AjPDomNode:removed node or NULL

Description

Removes and returns item from a map

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomNodeMapRemoveItemC

Removes and returns item from a map

Synopsis

Prototype
AjPDomNode ajDomNodeMapRemoveItemC (
      AjPDomNodeMap map,
      const char* name
);

TypeNameRead/WriteDescription
AjPDomNodeMapmapOutputmap
const char*nameInputname
AjPDomNode RETURNremoved node or NULL

Input
name:(Input)name
Output
map:(Output)map
Returns
AjPDomNode:removed node or NULL

Description

Removes and returns item from a map

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomNodeMapItem

Return the node in the map at a given index

Synopsis

Prototype
AjPDomNode ajDomNodeMapItem (
      const AjPDomNodeMap map,
      ajint indexnum
);

TypeNameRead/WriteDescription
const AjPDomNodeMapmapInputmap
ajintindexnumInputindex
AjPDomNode RETURNnode or NULL

Input
map:(Input)map
indexnum:(Input)index
Returns
AjPDomNode:node or NULL

Description

Return the node in the map at a given index

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomNodeListItem

Return the node in the list at a given index

Synopsis

Prototype
AjPDomNode ajDomNodeListItem (
      const AjPDomNodeList list,
      ajint indexnum
);

TypeNameRead/WriteDescription
const AjPDomNodeListlistInputlist
ajintindexnumInputindex
AjPDomNode RETURNnode or NULL

Input
list:(Input)list
indexnum:(Input)index
Returns
AjPDomNode:node or NULL

Description

Return the node in the list at a given index

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomElementSetAttribute

Adds a new attribute or sets the value of an existing attribute.

Synopsis

Prototype
void ajDomElementSetAttribute (
      const AjPDomElement element,
      const AjPStr name,
      const AjPStr value
);

TypeNameRead/WriteDescription
const AjPDomElementelementInputelement
const AjPStrnameInputname
const AjPStrvalueInputvalue
void RETURN

Input
element:(Input)element
name:(Input)name
value:(Input)value
Returns
void:No return value

Description

Adds a new attribute or sets the value of an existing attribute.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomElementSetAttributeC

Adds a new attribute or sets the value of an existing attribute.

Synopsis

Prototype
void ajDomElementSetAttributeC (
      const AjPDomElement element,
      const char* name,
      const char* value
);

TypeNameRead/WriteDescription
const AjPDomElementelementInputelement
const char*nameInputname
const char*valueInputvalue
void RETURN

Input
element:(Input)element
name:(Input)name
value:(Input)value
Returns
void:No return value

Description

Adds a new attribute or sets the value of an existing attribute.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomElementRemoveAttribute

Remove and free a named attribute

Synopsis

Prototype
void ajDomElementRemoveAttribute (
      AjPDomElement element,
      const AjPStr name
);

TypeNameRead/WriteDescription
AjPDomElementelementModifyelement
const AjPStrnameInputname
void RETURN

Input
name:(Input)name
Input & Output
element:(Modify)element
Returns
void:No return value

Description

Remove and free a named attribute

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomElementRemoveAttributeC

Remove and free a named attribute

Synopsis

Prototype
void ajDomElementRemoveAttributeC (
      AjPDomElement element,
      const char* name
);

TypeNameRead/WriteDescription
AjPDomElementelementModifyelement
const char*nameInputname
void RETURN

Input
name:(Input)name
Input & Output
element:(Modify)element
Returns
void:No return value

Description

Remove and free a named attribute

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomElementGetAttributeNode

Returns the named attribute node.

Synopsis

Prototype
AjPDomNode ajDomElementGetAttributeNode (
      const AjPDomElement element,
      const AjPStr name
);

TypeNameRead/WriteDescription
const AjPDomElementelementInputelement
const AjPStrnameInputname
AjPDomNode RETURNnode or NULL

Input
element:(Input)element
name:(Input)name
Returns
AjPDomNode:node or NULL

Description

Returns the named attribute node.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomElementGetAttributeNodeC

Returns the named attribute node.

Synopsis

Prototype
AjPDomNode ajDomElementGetAttributeNodeC (
      const AjPDomElement element,
      const char* name
);

TypeNameRead/WriteDescription
const AjPDomElementelementInputelement
const char*nameInputname
AjPDomNode RETURNnode or NULL

Input
element:(Input)element
name:(Input)name
Returns
AjPDomNode:node or NULL

Description

Returns the named attribute node.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomElementSetAttributeNode

Add an attribute to the attributes of an element. If this element already has an attribute with the same name it will be replaced with the new attribute and returned.

Synopsis

Prototype
AjPDomNode ajDomElementSetAttributeNode (
      AjPDomElement element,
      AjPDomNode newattr
);

TypeNameRead/WriteDescription
AjPDomElementelementModifyelement
AjPDomNodenewattrModifyname
AjPDomNode RETURNnew or replaced attribute

Input & Output
element:(Modify)element
newattr:(Modify)name
Returns
AjPDomNode:new or replaced attribute

Description

Add an attribute to the attributes of an element. If this element already has an attribute with the same name it will be replaced with the new attribute and returned.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomElementRemoveAttributeNode

Removes and returns a pointer to an attribute

Synopsis

Prototype
AjPDomNode ajDomElementRemoveAttributeNode (
      AjPDomElement element,
      AjPDomNode oldattr
);

TypeNameRead/WriteDescription
AjPDomElementelementOutputelement
AjPDomNodeoldattrModifyattribute
AjPDomNode RETURNremoved attribute or NULL

Output
element:(Output)element
Input & Output
oldattr:(Modify)attribute
Returns
AjPDomNode:removed attribute or NULL

Description

Removes and returns a pointer to an attribute

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomElementGetElementsByTagName

Perform a pre-order traversal of the entire document. Return a node list of the elements with the name tagname in the order in which they are found.

Synopsis

Prototype
AjPDomNodeList ajDomElementGetElementsByTagName (
      AjPDomElement element,
      const AjPStr name
);

TypeNameRead/WriteDescription
AjPDomElementelementModifyelement
const AjPStrnameInputname
AjPDomNodeList RETURNnode list

Input
name:(Input)name
Input & Output
element:(Modify)element
Returns
AjPDomNodeList:node list

Description

Perform a pre-order traversal of the entire document. Return a node list of the elements with the name tagname in the order in which they are found.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomElementGetElementsByTagNameC

Perform a pre-order traversal of the entire document. Return a node list of the elements with the name tagname in the order in which they are found.

Synopsis

Prototype
AjPDomNodeList ajDomElementGetElementsByTagNameC (
      AjPDomElement element,
      const char* name
);

TypeNameRead/WriteDescription
AjPDomElementelementModifyelement
const char*nameInputname
AjPDomNodeList RETURNnode list

Input
name:(Input)name
Input & Output
element:(Modify)element
Returns
AjPDomNodeList:node list

Description

Perform a pre-order traversal of the entire document. Return a node list of the elements with the name tagname in the order in which they are found.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomElementNormalise

Merge adjacent text node content into "normal" form in the subtree of a node. Remove empty text node.

Synopsis

Prototype
void ajDomElementNormalise (
      AjPDomElement element
);

TypeNameRead/WriteDescription
AjPDomElementelementOutputelement
void RETURN

Output
element:(Output)element
Returns
void:No return value

Description

Merge adjacent text node content into "normal" form in the subtree of a node. Remove empty text node.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomCharacterDataSubstringData

Return a string representing the substring beginning at the character at offset with a length of count. If the sum of offset and count exceeds the length of the character data, a string representing the remainder of the string is returned.

Synopsis

Prototype
AjPStr ajDomCharacterDataSubstringData (
      const AjPDomCharacterData data,
      ajint offset,
      ajint count
);

TypeNameRead/WriteDescription
const AjPDomCharacterDatadataInputcharacter data
ajintoffsetInputoffset
ajintcountInputcount
AjPStr RETURNsubstring

Input
data:(Input)character data
offset:(Input)offset
count:(Input)count
Returns
AjPStr:substring

Description

Return a string representing the substring beginning at the character at offset with a length of count. If the sum of offset and count exceeds the length of the character data, a string representing the remainder of the string is returned.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomCharacterDataAppendData

Append a string to a character data node

Synopsis

Prototype
void ajDomCharacterDataAppendData (
      AjPDomCharacterData data,
      const AjPStr arg
);

TypeNameRead/WriteDescription
AjPDomCharacterDatadataOutputcharacter data
const AjPStrargInputstring
void RETURN

Input
arg:(Input)string
Output
data:(Output)character data
Returns
void:No return value

Description

Append a string to a character data node

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomCharacterDataAppendDataC

Append a string to a character data node

Synopsis

Prototype
void ajDomCharacterDataAppendDataC (
      AjPDomCharacterData data,
      const char* arg
);

TypeNameRead/WriteDescription
AjPDomCharacterDatadataOutputcharacter data
const char*argInputstring
void RETURN

Input
arg:(Input)string
Output
data:(Output)character data
Returns
void:No return value

Description

Append a string to a character data node

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomCharacterDataInsertData

Insert a string at position offset

Synopsis

Prototype
void ajDomCharacterDataInsertData (
      AjPDomCharacterData data,
      ajint offset,
      const AjPStr arg
);

TypeNameRead/WriteDescription
AjPDomCharacterDatadataOutputcharacter data
ajintoffsetInputoffset
const AjPStrargInputstring
void RETURN

Input
offset:(Input)offset
arg:(Input)string
Output
data:(Output)character data
Returns
void:No return value

Description

Insert a string at position offset

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomCharacterDataInsertDataC

Insert a string at position offset

Synopsis

Prototype
void ajDomCharacterDataInsertDataC (
      AjPDomCharacterData data,
      ajint offset,
      const char* arg
);

TypeNameRead/WriteDescription
AjPDomCharacterDatadataOutputcharacter data
ajintoffsetInputoffset
const char*argInputstring
void RETURN

Input
offset:(Input)offset
arg:(Input)string
Output
data:(Output)character data
Returns
void:No return value

Description

Insert a string at position offset

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomCharacterDataDeleteData

Remove at most count characters of position offset

Synopsis

Prototype
void ajDomCharacterDataDeleteData (
      AjPDomCharacterData data,
      ajint offset,
      ajint count
);

TypeNameRead/WriteDescription
AjPDomCharacterDatadataOutputcharacter data
ajintoffsetInputoffset
ajintcountInputcount
void RETURN

Input
offset:(Input)offset
count:(Input)count
Output
data:(Output)character data
Returns
void:No return value

Description

Remove at most count characters of position offset

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomCharacterDataReplaceData

Replace offset/count characters with a string

Synopsis

Prototype
void ajDomCharacterDataReplaceData (
      AjPDomCharacterData data,
      ajint offset,
      ajint count,
      const AjPStr arg
);

TypeNameRead/WriteDescription
AjPDomCharacterDatadataOutputcharacter data
ajintoffsetInputoffset
ajintcountInputcount
const AjPStrargInputreplacement string
void RETURN

Input
offset:(Input)offset
count:(Input)count
arg:(Input)replacement string
Output
data:(Output)character data
Returns
void:No return value

Description

Replace offset/count characters with a string

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomCharacterDataReplaceDataC

Replace offset/count characters with a string

Synopsis

Prototype
void ajDomCharacterDataReplaceDataC (
      AjPDomCharacterData data,
      ajint offset,
      ajint count,
      const char* arg
);

TypeNameRead/WriteDescription
AjPDomCharacterDatadataOutputcharacter data
ajintoffsetInputoffset
ajintcountInputcount
const char*argInputreplacement string
void RETURN

Input
offset:(Input)offset
count:(Input)count
arg:(Input)replacement string
Output
data:(Output)character data
Returns
void:No return value

Description

Replace offset/count characters with a string

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomCharacterDataGetLength

Return length of character data

Synopsis

Prototype
ajint ajDomCharacterDataGetLength (
      const AjPDomCharacterData data
);

TypeNameRead/WriteDescription
const AjPDomCharacterDatadataInputcharacter data
ajint RETURNlength

Input
data:(Input)character data
Returns
ajint:length

Description

Return length of character data

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomTextSplitText

Split a text node at the specified offset into two adjacent text nodes. The first is a string offset size in length whereas the second is the remainder. If offset is equal to the length of the string the new sibling has zero length

Synopsis

Prototype
AjPDomText ajDomTextSplitText (
      AjPDomText text,
      ajint offset
);

TypeNameRead/WriteDescription
AjPDomTexttextOutputtext
ajintoffsetInputoffset
AjPDomText RETURNremainder node or NULL

Input
offset:(Input)offset
Output
text:(Output)text
Returns
AjPDomText:remainder node or NULL

Description

Split a text node at the specified offset into two adjacent text nodes. The first is a string offset size in length whereas the second is the remainder. If offset is equal to the length of the string the new sibling has zero length

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomDocumentCreateElement

Create a document element

Synopsis

Prototype
AjPDomElement ajDomDocumentCreateElement (
      AjPDomDocument doc,
      const AjPStr tagname
);

TypeNameRead/WriteDescription
AjPDomDocumentdocOutputdocument
const AjPStrtagnameInputtagname
AjPDomElement RETURNelement

Input
tagname:(Input)tagname
Output
doc:(Output)document
Returns
AjPDomElement:element

Description

Create a document element

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomDocumentCreateElementC

Create a document element

Synopsis

Prototype
AjPDomElement ajDomDocumentCreateElementC (
      AjPDomDocument doc,
      const char* tagname
);

TypeNameRead/WriteDescription
AjPDomDocumentdocOutputdocument
const char*tagnameInputtagname
AjPDomElement RETURNelement

Input
tagname:(Input)tagname
Output
doc:(Output)document
Returns
AjPDomElement:element

Description

Create a document element

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomDocumentCreateDocumentFragment

Create an empty document fragment

Synopsis

Prototype
AjPDomDocumentFragment ajDomDocumentCreateDocumentFragment (
      AjPDomDocument doc
);

TypeNameRead/WriteDescription
AjPDomDocumentdocOutputdocument
AjPDomDocumentFragment RETURNfragment

Output
doc:(Output)document
Returns
AjPDomDocumentFragment:fragment

Description

Create an empty document fragment

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomDocumentCreateTextNode

Create a text node

Synopsis

Prototype
AjPDomText ajDomDocumentCreateTextNode (
      AjPDomDocument doc,
      const AjPStr data
);

TypeNameRead/WriteDescription
AjPDomDocumentdocOutputdocument
const AjPStrdataInputtext
AjPDomText RETURNtext node

Input
data:(Input)text
Output
doc:(Output)document
Returns
AjPDomText:text node

Description

Create a text node

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomDocumentCreateTextNodeC

Create a text node

Synopsis

Prototype
AjPDomText ajDomDocumentCreateTextNodeC (
      AjPDomDocument doc,
      const char* data
);

TypeNameRead/WriteDescription
AjPDomDocumentdocOutputdocument
const char*dataInputtext
AjPDomText RETURNtext node

Input
data:(Input)text
Output
doc:(Output)document
Returns
AjPDomText:text node

Description

Create a text node

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomDocumentCreateComment

Create a comment node

Synopsis

Prototype
AjPDomComment ajDomDocumentCreateComment (
      AjPDomDocument doc,
      const AjPStr data
);

TypeNameRead/WriteDescription
AjPDomDocumentdocOutputdocument
const AjPStrdataInputtext
AjPDomComment RETURNcomment node

Input
data:(Input)text
Output
doc:(Output)document
Returns
AjPDomComment:comment node

Description

Create a comment node

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomDocumentCreateCommentC

Create a comment node

Synopsis

Prototype
AjPDomComment ajDomDocumentCreateCommentC (
      AjPDomDocument doc,
      const char* data
);

TypeNameRead/WriteDescription
AjPDomDocumentdocOutputdocument
const char*dataInputtext
AjPDomComment RETURNcomment node

Input
data:(Input)text
Output
doc:(Output)document
Returns
AjPDomComment:comment node

Description

Create a comment node

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomDocumentCreateCDATASection

Create a CDATA section

Synopsis

Prototype
AjPDomCDATASection ajDomDocumentCreateCDATASection (
      AjPDomDocument doc,
      const AjPStr data
);

TypeNameRead/WriteDescription
AjPDomDocumentdocOutputdocument
const AjPStrdataInputtext
AjPDomCDATASection RETURNcomment node

Input
data:(Input)text
Output
doc:(Output)document
Returns
AjPDomCDATASection:comment node

Description

Create a CDATA section

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomDocumentCreateCDATASectionC

Create a CDATA section

Synopsis

Prototype
AjPDomCDATASection ajDomDocumentCreateCDATASectionC (
      AjPDomDocument doc,
      const char* data
);

TypeNameRead/WriteDescription
AjPDomDocumentdocOutputdocument
const char*dataInputtext
AjPDomCDATASection RETURNcomment node

Input
data:(Input)text
Output
doc:(Output)document
Returns
AjPDomCDATASection:comment node

Description

Create a CDATA section

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomDocumentCreateAttribute

Create an attribute node

Synopsis

Prototype
AjPDomAttr ajDomDocumentCreateAttribute (
      AjPDomDocument doc,
      const AjPStr name
);

TypeNameRead/WriteDescription
AjPDomDocumentdocOutputdocument
const AjPStrnameInputtext
AjPDomAttr RETURNattribute node

Input
name:(Input)text
Output
doc:(Output)document
Returns
AjPDomAttr:attribute node

Description

Create an attribute node

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomDocumentCreateAttributeC

Create an attribute node

Synopsis

Prototype
AjPDomAttr ajDomDocumentCreateAttributeC (
      AjPDomDocument doc,
      const char* name
);

TypeNameRead/WriteDescription
AjPDomDocumentdocOutputdocument
const char*nameInputtext
AjPDomAttr RETURNattribute node

Input
name:(Input)text
Output
doc:(Output)document
Returns
AjPDomAttr:attribute node

Description

Create an attribute node

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomDocumentCreateEntityReference

Create an entity reference node

Synopsis

Prototype
AjPDomEntityReference ajDomDocumentCreateEntityReference (
      AjPDomDocument doc,
      const AjPStr name
);

TypeNameRead/WriteDescription
AjPDomDocumentdocOutputdocument
const AjPStrnameInputtext
AjPDomEntityReference RETURNentity reference node

Input
name:(Input)text
Output
doc:(Output)document
Returns
AjPDomEntityReference:entity reference node

Description

Create an entity reference node

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomDocumentCreateEntityReferenceC

Create an entity reference node

Synopsis

Prototype
AjPDomEntityReference ajDomDocumentCreateEntityReferenceC (
      AjPDomDocument doc,
      const char* name
);

TypeNameRead/WriteDescription
AjPDomDocumentdocOutputdocument
const char*nameInputtext
AjPDomEntityReference RETURNentity reference node

Input
name:(Input)text
Output
doc:(Output)document
Returns
AjPDomEntityReference:entity reference node

Description

Create an entity reference node

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomDocumentCreateProcessingInstruction

Create a processing instruction node

Synopsis

Prototype
AjPDomPi ajDomDocumentCreateProcessingInstruction (
      AjPDomDocument doc,
      const AjPStr target,
      const AjPStr data
);

TypeNameRead/WriteDescription
AjPDomDocumentdocOutputdocument
const AjPStrtargetInputtarget
const AjPStrdataInputdata
AjPDomPi RETURNentity reference node

Input
target:(Input)target
data:(Input)data
Output
doc:(Output)document
Returns
AjPDomPi:entity reference node

Description

Create a processing instruction node

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomDocumentCreateProcessingInstructionC

Create a processing instruction node

Synopsis

Prototype
AjPDomPi ajDomDocumentCreateProcessingInstructionC (
      AjPDomDocument doc,
      const char* target,
      const char* data
);

TypeNameRead/WriteDescription
AjPDomDocumentdocOutputdocument
const char*targetInputtarget
const char*dataInputdata
AjPDomPi RETURNentity reference node

Input
target:(Input)target
data:(Input)data
Output
doc:(Output)document
Returns
AjPDomPi:entity reference node

Description

Create a processing instruction node

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomDocumentGetElementsByTagName

Perform a pre-order traversal of the entire document. Return a node list of the elements matching tagname in the order in which they are found.

Synopsis

Prototype
AjPDomNodeList ajDomDocumentGetElementsByTagName (
      AjPDomDocument doc,
      const AjPStr name
);

TypeNameRead/WriteDescription
AjPDomDocumentdocModifydocument
const AjPStrnameInputname
AjPDomNodeList RETURNnode list

Input
name:(Input)name
Input & Output
doc:(Modify)document
Returns
AjPDomNodeList:node list

Description

Perform a pre-order traversal of the entire document. Return a node list of the elements matching tagname in the order in which they are found.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomDocumentGetElementsByTagNameC

Perform a pre-order traversal of the entire document. Return a node list of the elements matching tagname in the order in which they are found.

Synopsis

Prototype
AjPDomNodeList ajDomDocumentGetElementsByTagNameC (
      AjPDomDocument doc,
      const char* name
);

TypeNameRead/WriteDescription
AjPDomDocumentdocModifydocument
const char*nameInputname
AjPDomNodeList RETURNnode list

Input
name:(Input)name
Input & Output
doc:(Modify)document
Returns
AjPDomNodeList:node list

Description

Perform a pre-order traversal of the entire document. Return a node list of the elements matching tagname in the order in which they are found.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomDocumentGetDoctype

Get document type

Synopsis

Prototype
AjPDomDocumentType ajDomDocumentGetDoctype (
      const AjPDomDocument doc
);

TypeNameRead/WriteDescription
const AjPDomDocumentdocInputdocument
AjPDomDocumentType RETURNdoctype

Input
doc:(Input)document
Returns
AjPDomDocumentType:doctype

Description

Get document type

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomDocumentGetDocumentElement

Get the root element of the document tree. The root element is also accessible through the child nodes node list member, however the children of a document may also be processing instructions, document type nodes, and comments which may precede the document element in the list.

Synopsis

Prototype
AjPDomElement ajDomDocumentGetDocumentElement (
      const AjPDomDocument doc
);

TypeNameRead/WriteDescription
const AjPDomDocumentdocInputdocument
AjPDomElement RETURNroot element

Input
doc:(Input)document
Returns
AjPDomElement:root element

Description

Get the root element of the document tree. The root element is also accessible through the child nodes node list member, however the children of a document may also be processing instructions, document type nodes, and comments which may precede the document element in the list.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomPrintNode

Print a node with indentation

Synopsis

Prototype
void ajDomPrintNode (
      const AjPDomNode node,
      ajint indent
);

TypeNameRead/WriteDescription
const AjPDomNodenodeInputnode
ajintindentInputindentation
void RETURN

Input
node:(Input)node
indent:(Input)indentation
Returns
void:No return value

Description

Print a node with indentation

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomPrintNode2

Print a node with zero indentation

Synopsis

Prototype
void ajDomPrintNode2 (
      const AjPDomNode node
);

TypeNameRead/WriteDescription
const AjPDomNodenodeInputnode
void RETURN

Input
node:(Input)node
Returns
void:No return value

Description

Print a node with zero indentation

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomNodePrintNode

Print a node internals

Synopsis

Prototype
void ajDomNodePrintNode (
      const AjPDomNode node
);

TypeNameRead/WriteDescription
const AjPDomNodenodeInputnode
void RETURN

Input
node:(Input)node
Returns
void:No return value

Description

Print a node internals

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomNodeInsertBefore

Insert newchild into node directly before the existing child refchild. If refchild is a null pointer, newchild will be appended to the list. If newchild is a fragment node, all children are moved into this node in the same order before refchild. If newchild is already in the list it will first be removed.

Synopsis

Prototype
AjPDomNode ajDomNodeInsertBefore (
      AjPDomNode node,
      AjPDomNode newchild,
      AjPDomNode refchild
);

TypeNameRead/WriteDescription
AjPDomNodenodeOutputnode
AjPDomNodenewchildModifynode to insert
AjPDomNoderefchildModifynode to insert before
AjPDomNode RETURNinserted node

Output
node:(Output)node
Input & Output
newchild:(Modify)node to insert
refchild:(Modify)node to insert before
Returns
AjPDomNode:inserted node

Description

Insert newchild into node directly before the existing child refchild. If refchild is a null pointer, newchild will be appended to the list. If newchild is a fragment node, all children are moved into this node in the same order before refchild. If newchild is already in the list it will first be removed.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomNodeListInsert

Insert newchild into list directly before the existing child refchild.

Synopsis

Prototype
AjPDomNodeEntry ajDomNodeListInsert (
      AjPDomNodeList list,
      AjPDomNode newchild,
      AjPDomNode refchild
);

TypeNameRead/WriteDescription
AjPDomNodeListlistModifylist
AjPDomNodenewchildModifynode to insert
AjPDomNoderefchildModifynode to insert before
AjPDomNodeEntry RETURNinserted node

Input & Output
list:(Modify)list
newchild:(Modify)node to insert
refchild:(Modify)node to insert before
Returns
AjPDomNodeEntry:inserted node

Description

Insert newchild into list directly before the existing child refchild.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomNodeReplaceChild

Replace oldchild with newchild in the list of children.

Synopsis

Prototype
AjPDomNode ajDomNodeReplaceChild (
      AjPDomNode node,
      AjPDomNode newchild,
      AjPDomNode oldchild
);

TypeNameRead/WriteDescription
AjPDomNodenodeModifynode
AjPDomNodenewchildModifynode to insert
AjPDomNodeoldchildModifynode to replace
AjPDomNode RETURNoldchild node

Input & Output
node:(Modify)node
newchild:(Modify)node to insert
oldchild:(Modify)node to replace
Returns
AjPDomNode:oldchild node

Description

Replace oldchild with newchild in the list of children.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomNodeListReplace

Replace oldchild with newchild in a node list.

Synopsis

Prototype
AjPDomNodeEntry ajDomNodeListReplace (
      AjPDomNodeList list,
      AjPDomNode newchild,
      AjPDomNode oldchild
);

TypeNameRead/WriteDescription
AjPDomNodeListlistModifylist
AjPDomNodenewchildModifynode to insert
AjPDomNodeoldchildModifynode to replace
AjPDomNodeEntry RETURNinserted node

Input & Output
list:(Modify)list
newchild:(Modify)node to insert
oldchild:(Modify)node to replace
Returns
AjPDomNodeEntry:inserted node

Description

Replace oldchild with newchild in a node list.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomNodeCloneNode

Clone node

Synopsis

Prototype
AjPDomNode ajDomNodeCloneNode (
      AjPDomNode node,
      AjBool deep
);

TypeNameRead/WriteDescription
AjPDomNodenodeModifynode to clone
AjBooldeepInputdo a deep clone
AjPDomNode RETURNclone

Input
deep:(Input)do a deep clone
Input & Output
node:(Modify)node to clone
Returns
AjPDomNode:clone

Description

Clone node

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomNodeHasChildNodes

Check whether a node has any children

Synopsis

Prototype
AjBool ajDomNodeHasChildNodes (
      const AjPDomNode node
);

TypeNameRead/WriteDescription
const AjPDomNodenodeInputnode to clone
AjBool RETURNtrue if children

Input
node:(Input)node to clone
Returns
AjBool:true if children

Description

Check whether a node has any children

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomWrite

Write XML from memory

Synopsis

Prototype
ajint ajDomWrite (
      const AjPDomDocument node,
      AjPFile outf
);

TypeNameRead/WriteDescription
const AjPDomDocumentnodeInputdocument to write
AjPFileoutfModifyoutput file
ajint RETURNzero OK, negative if error

Input
node:(Input)document to write
Input & Output
outf:(Modify)output file
Returns
ajint:zero OK, negative if error

Description

Write XML from memory

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomWriteIndent

Write XML from memory

Synopsis

Prototype
ajint ajDomWriteIndent (
      const AjPDomDocument node,
      AjPFile outf,
      ajint indent
);

TypeNameRead/WriteDescription
const AjPDomDocumentnodeInputdocument to write
AjPFileoutfModifyoutput file
ajintindentInputindent level
ajint RETURNzero OK, negative if error

Input
node:(Input)document to write
indent:(Input)indent level
Input & Output
outf:(Modify)output file
Returns
ajint:zero OK, negative if error

Description

Write XML from memory

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomReadFp

Read XML into memory from a file pointer

Synopsis

Prototype
ajint ajDomReadFp (
      AjPDomDocument node,
      FILE* stream
);

TypeNameRead/WriteDescription
AjPDomDocumentnodeModifydocument to write
FILE*streamModifystream
ajint RETURNzero OK, negative if error

Input & Output
node:(Modify)document to write
stream:(Modify)stream
Returns
ajint:zero OK, negative if error

Description

Read XML into memory from a file pointer

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomReadFilebuff

Read XML into memory from a file pointer

Synopsis

Prototype
ajint ajDomReadFilebuff (
      AjPDomDocument node,
      AjPFilebuff buff
);

TypeNameRead/WriteDescription
AjPDomDocumentnodeModifydocument to write
AjPFilebuffbuffModifyFile buffer
ajint RETURNzero OK, negative if error

Input & Output
node:(Modify)document to write
buff:(Modify)File buffer
Returns
ajint:zero OK, negative if error

Description

Read XML into memory from a file pointer

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomReadString

Read XML into memory from a string

Synopsis

Prototype
ajint ajDomReadString (
      AjPDomDocument node,
      AjPStr str
);

TypeNameRead/WriteDescription
AjPDomDocumentnodeModifydocument to write
AjPStrstrModifyXML string
ajint RETURNzero OK, negative if error

Input & Output
node:(Modify)document to write
str:(Modify)XML string
Returns
ajint:zero OK, negative if error

Description

Read XML into memory from a string

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomTextGetText

Return the text from a text node

Synopsis

Prototype
AjPStr ajDomTextGetText (
      AjPDomText text
);

TypeNameRead/WriteDescription
AjPDomTexttextOutputtext
AjPStr RETURNtext or NULL

Output
text:(Output)text
Returns
AjPStr:text or NULL

Description

Return the text from a text node

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomElementGetText

Return the text from an element node

Synopsis

Prototype
AjPStr ajDomElementGetText (
      AjPDomElement element
);

TypeNameRead/WriteDescription
AjPDomElementelementOutputelement
AjPStr RETURNtext or NULL

Output
element:(Output)element
Returns
AjPStr:text or NULL

Description

Return the text from an element node

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomElementGetNthChildByTagNameC

Returns the nth child of a named element

Synopsis

Prototype
AjPDomElement ajDomElementGetNthChildByTagNameC (
      AjPDomDocument doc,
      AjPDomElement element,
      const char* name,
      ajint n
);

TypeNameRead/WriteDescription
AjPDomDocumentdocModifydoc
AjPDomElementelementModifyelement
const char*nameInputelement name
ajintnInputnumber of child to get
AjPDomElement RETURNchild or NULL

Input
name:(Input)element name
n:(Input)number of child to get
Input & Output
doc:(Modify)doc
element:(Modify)element
Returns
AjPDomElement:child or NULL

Description

Returns the nth child of a named element

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajDomElementGetFirstChildByTagNameC

Returns the 1st child of a named element

Synopsis

Prototype
AjPDomElement ajDomElementGetFirstChildByTagNameC (
      AjPDomDocument doc,
      AjPDomElement element,
      const char* name
);

TypeNameRead/WriteDescription
AjPDomDocumentdocModifydoc
AjPDomElementelementModifyelement
const char*nameInputelement name
AjPDomElement RETURNchild or NULL

Input
name:(Input)element name
Input & Output
doc:(Modify)doc
element:(Modify)element
Returns
AjPDomElement:child or NULL

Description

Returns the 1st child of a named element

See Also

See other functions in this section

Availability

In release 6.4.0