ajdom.c
Return the length of a DOM node list
Synopsis
Prototype
ajint ajDomNodeListGetLen (
const AjPDomNodeList list
);
Type | Name | Read/Write | Description |
const AjPDomNodeList | list | Input | node list |
ajint | | RETURN | Length (-1 if error) |
Input
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
Append a child node to a DOM node list
Synopsis
Prototype
AjPDomNodeEntry ajDomNodeListAppend (
AjPDomNodeList list,
AjPDomNode child
);
Type | Name | Read/Write | Description |
AjPDomNodeList | list | Output | node list |
AjPDomNode | child | Modify | child |
AjPDomNodeEntry | | RETURN | Node list child entry created |
Output
Input & Output
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
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
);
Type | Name | Read/Write | Description |
AjPDomNode | node | Output | node |
AjPDomNode | extrachild | Modify | extra child |
AjPDomNode | | RETURN | Pointer to extrachild or NULL if error |
Output
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
Removes a child node from a list of children
Synopsis
Prototype
AjPDomNode ajDomRemoveChild (
AjPDomNode node,
AjPDomNode child
);
Type | Name | Read/Write | Description |
AjPDomNode | node | Output | node |
AjPDomNode | child | Modify | child to remove |
AjPDomNode | | RETURN | child removed |
Output
Input & Output
child: | (Modify) | child to remove |
Returns
Description
Removes a child node from a list of children
See Also
See other functions in this section
Availability
In release 6.4.0
Check whether a child exists in a node list
Synopsis
Prototype
AjBool ajDomNodeListExists (
AjPDomNodeList list,
const AjPDomNode child
);
Type | Name | Read/Write | Description |
AjPDomNodeList | list | Modify | list |
const AjPDomNode | child | Input | child |
AjBool | | RETURN | true if child is in the list |
Input
Input & Output
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
Remove a child from a node list
Synopsis
Prototype
AjPDomNodeEntry ajDomNodeListRemove (
AjPDomNodeList list,
AjPDomNode child
);
Type | Name | Read/Write | Description |
AjPDomNodeList | list | Output | list |
AjPDomNode | child | Modify | child |
AjPDomNodeEntry | | RETURN | child removed or NULL if not found |
Output
Input & Output
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
Frees a node and its children
Synopsis
Prototype
void ajDomDocumentDestroyNode (
AjPDomDocument doc,
AjPDomNode node
);
Type | Name | Read/Write | Description |
AjPDomDocument | doc | Output | document |
AjPDomNode | node | Output | node |
void | | RETURN | |
Output
doc: | (Output) | document |
node: | (Output) | node |
Returns
Description
Frees a node and its children
See Also
See other functions in this section
Availability
In release 6.4.0
Frees a node list
Synopsis
Prototype
void ajDomDocumentDestroyNodeList (
AjPDomDocument doc,
AjPDomNodeList list,
AjBool donodes
);
Type | Name | Read/Write | Description |
AjPDomDocument | doc | Output | document |
AjPDomNodeList | list | Output | list |
AjBool | donodes | Input | free nodes as well if true |
void | | RETURN | |
Input
donodes: | (Input) | free nodes as well if true |
Output
doc: | (Output) | document |
list: | (Output) | list |
Returns
Description
Frees a node list
See Also
See other functions in this section
Availability
In release 6.4.0
Create a node list
Synopsis
Prototype
AjPDomNodeList ajDomCreateNodeList (
AjPDomDocument doc
);
Type | Name | Read/Write | Description |
AjPDomDocument | doc | Modify | document |
AjPDomNodeList | | RETURN | new list |
Input & Output
Returns
Description
Create a node list
See Also
See other functions in this section
Availability
In release 6.4.0
General document node creation
Synopsis
Prototype
AjPDomNode ajDomDocumentCreateNode (
AjPDomDocument doc,
ajuint nodetype
);
Type | Name | Read/Write | Description |
AjPDomDocument | doc | Modify | document |
ajuint | nodetype | Input | type of node to create |
AjPDomNode | | RETURN | new node |
Input
nodetype: | (Input) | type of node to create |
Input & Output
Returns
Description
General document node creation
See Also
See other functions in this section
Availability
In release 6.4.0
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
);
Type | Name | Read/Write | Description |
const AjPStr | qualname | Input | qualified name |
const AjPStr | publicid | Input | public id |
const AjPStr | systemid | Input | systemid |
AjPDomDocumentType | | RETURN | new 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
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
);
Type | Name | Read/Write | Description |
const char* | qualname | Input | qualified name |
const char* | publicid | Input | public id |
const char* | systemid | Input | systemid |
AjPDomDocumentType | | RETURN | new 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
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
);
Type | Name | Read/Write | Description |
const AjPStr | uri | Input | uri (not implemented. Pass NULL) |
const AjPStr | qualname | Input | qualified name |
AjPDomDocumentType | doctype | Modify | doctype |
AjPDomDocument | | RETURN | new document |
Input
uri: | (Input) | uri (not implemented. Pass NULL) |
qualname: | (Input) | qualified name |
Input & Output
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
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
);
Type | Name | Read/Write | Description |
const char* | uri | Input | uri (not implemented. Pass NULL) |
const char* | qualname | Input | qualified name |
AjPDomDocumentType | doctype | Modify | doctype |
AjPDomDocument | | RETURN | new document |
Input
uri: | (Input) | uri (not implemented. Pass NULL) |
qualname: | (Input) | qualified name |
Input & Output
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
Returns the named node from a node map
Synopsis
Prototype
AjPDomNode ajDomNodeMapGetItem (
const AjPDomNodeMap map,
const AjPStr name
);
Type | Name | Read/Write | Description |
const AjPDomNodeMap | map | Input | map |
const AjPStr | name | Input | name |
AjPDomNode | | RETURN | node |
Input
map: | (Input) | map |
name: | (Input) | name |
Returns
Description
Returns the named node from a node map
See Also
See other functions in this section
Availability
In release 6.4.0
Returns the named node from a node map
Synopsis
Prototype
AjPDomNode ajDomNodeMapGetItemC (
const AjPDomNodeMap map,
const char* name
);
Type | Name | Read/Write | Description |
const AjPDomNodeMap | map | Input | map |
const char* | name | Input | name |
AjPDomNode | | RETURN | node |
Input
map: | (Input) | map |
name: | (Input) | name |
Returns
Description
Returns the named node from a node map
See Also
See other functions in this section
Availability
In release 6.4.0
Returns the value of a named attribute
Synopsis
Prototype
AjPStr ajDomElementGetAttribute (
const AjPDomElement element,
const AjPStr name
);
Type | Name | Read/Write | Description |
const AjPDomElement | element | Input | element |
const AjPStr | name | Input | name |
AjPStr | | RETURN | value 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
Returns the value of a named attribute
Synopsis
Prototype
AjPStr ajDomElementGetAttributeC (
const AjPDomElement element,
const char* name
);
Type | Name | Read/Write | Description |
const AjPDomElement | element | Input | element |
const char* | name | Input | name |
AjPStr | | RETURN | value 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
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
);
Type | Name | Read/Write | Description |
AjPDomNodeMap | map | Modify | map |
AjPDomNode | arg | Modify | arg |
AjPDomNode | | RETURN | replaced 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
Removes and returns item from a map
Synopsis
Prototype
AjPDomNode ajDomNodeMapRemoveItem (
AjPDomNodeMap map,
const AjPStr name
);
Type | Name | Read/Write | Description |
AjPDomNodeMap | map | Modify | map |
const AjPStr | name | Input | name |
AjPDomNode | | RETURN | removed node or NULL |
Input
Input & Output
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
Removes and returns item from a map
Synopsis
Prototype
AjPDomNode ajDomNodeMapRemoveItemC (
AjPDomNodeMap map,
const char* name
);
Type | Name | Read/Write | Description |
AjPDomNodeMap | map | Output | map |
const char* | name | Input | name |
AjPDomNode | | RETURN | removed node or NULL |
Input
Output
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
Return the node in the map at a given index
Synopsis
Prototype
AjPDomNode ajDomNodeMapItem (
const AjPDomNodeMap map,
ajint indexnum
);
Type | Name | Read/Write | Description |
const AjPDomNodeMap | map | Input | map |
ajint | indexnum | Input | index |
AjPDomNode | | RETURN | node or NULL |
Input
map: | (Input) | map |
indexnum: | (Input) | index |
Returns
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
Return the node in the list at a given index
Synopsis
Prototype
AjPDomNode ajDomNodeListItem (
const AjPDomNodeList list,
ajint indexnum
);
Type | Name | Read/Write | Description |
const AjPDomNodeList | list | Input | list |
ajint | indexnum | Input | index |
AjPDomNode | | RETURN | node or NULL |
Input
list: | (Input) | list |
indexnum: | (Input) | index |
Returns
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
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
);
Type | Name | Read/Write | Description |
const AjPDomElement | element | Input | element |
const AjPStr | name | Input | name |
const AjPStr | value | Input | value |
void | | RETURN | |
Input
element: | (Input) | element |
name: | (Input) | name |
value: | (Input) | value |
Returns
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
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
);
Type | Name | Read/Write | Description |
const AjPDomElement | element | Input | element |
const char* | name | Input | name |
const char* | value | Input | value |
void | | RETURN | |
Input
element: | (Input) | element |
name: | (Input) | name |
value: | (Input) | value |
Returns
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
Remove and free a named attribute
Synopsis
Prototype
void ajDomElementRemoveAttribute (
AjPDomElement element,
const AjPStr name
);
Type | Name | Read/Write | Description |
AjPDomElement | element | Modify | element |
const AjPStr | name | Input | name |
void | | RETURN | |
Input
Input & Output
Returns
Description
Remove and free a named attribute
See Also
See other functions in this section
Availability
In release 6.4.0
Remove and free a named attribute
Synopsis
Prototype
void ajDomElementRemoveAttributeC (
AjPDomElement element,
const char* name
);
Type | Name | Read/Write | Description |
AjPDomElement | element | Modify | element |
const char* | name | Input | name |
void | | RETURN | |
Input
Input & Output
Returns
Description
Remove and free a named attribute
See Also
See other functions in this section
Availability
In release 6.4.0
Returns the named attribute node.
Synopsis
Prototype
AjPDomNode ajDomElementGetAttributeNode (
const AjPDomElement element,
const AjPStr name
);
Type | Name | Read/Write | Description |
const AjPDomElement | element | Input | element |
const AjPStr | name | Input | name |
AjPDomNode | | RETURN | node or NULL |
Input
element: | (Input) | element |
name: | (Input) | name |
Returns
Description
Returns the named attribute node.
See Also
See other functions in this section
Availability
In release 6.4.0
Returns the named attribute node.
Synopsis
Prototype
AjPDomNode ajDomElementGetAttributeNodeC (
const AjPDomElement element,
const char* name
);
Type | Name | Read/Write | Description |
const AjPDomElement | element | Input | element |
const char* | name | Input | name |
AjPDomNode | | RETURN | node or NULL |
Input
element: | (Input) | element |
name: | (Input) | name |
Returns
Description
Returns the named attribute node.
See Also
See other functions in this section
Availability
In release 6.4.0
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
);
Type | Name | Read/Write | Description |
AjPDomElement | element | Modify | element |
AjPDomNode | newattr | Modify | name |
AjPDomNode | | RETURN | new 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
Removes and returns a pointer to an attribute
Synopsis
Prototype
AjPDomNode ajDomElementRemoveAttributeNode (
AjPDomElement element,
AjPDomNode oldattr
);
Type | Name | Read/Write | Description |
AjPDomElement | element | Output | element |
AjPDomNode | oldattr | Modify | attribute |
AjPDomNode | | RETURN | removed attribute or NULL |
Output
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
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
);
Type | Name | Read/Write | Description |
AjPDomElement | element | Modify | element |
const AjPStr | name | Input | name |
AjPDomNodeList | | RETURN | node list |
Input
Input & Output
Returns
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
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
);
Type | Name | Read/Write | Description |
AjPDomElement | element | Modify | element |
const char* | name | Input | name |
AjPDomNodeList | | RETURN | node list |
Input
Input & Output
Returns
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
Merge adjacent text node content into "normal" form in the subtree of
a node. Remove empty text node.
Synopsis
Prototype
void ajDomElementNormalise (
AjPDomElement element
);
Type | Name | Read/Write | Description |
AjPDomElement | element | Output | element |
void | | RETURN | |
Output
Returns
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
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
);
Type | Name | Read/Write | Description |
const AjPDomCharacterData | data | Input | character data |
ajint | offset | Input | offset |
ajint | count | Input | count |
AjPStr | | RETURN | substring |
Input
data: | (Input) | character data |
offset: | (Input) | offset |
count: | (Input) | count |
Returns
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
Append a string to a character data node
Synopsis
Prototype
void ajDomCharacterDataAppendData (
AjPDomCharacterData data,
const AjPStr arg
);
Type | Name | Read/Write | Description |
AjPDomCharacterData | data | Output | character data |
const AjPStr | arg | Input | string |
void | | RETURN | |
Input
Output
data: | (Output) | character data |
Returns
Description
Append a string to a character data node
See Also
See other functions in this section
Availability
In release 6.4.0
Append a string to a character data node
Synopsis
Prototype
void ajDomCharacterDataAppendDataC (
AjPDomCharacterData data,
const char* arg
);
Type | Name | Read/Write | Description |
AjPDomCharacterData | data | Output | character data |
const char* | arg | Input | string |
void | | RETURN | |
Input
Output
data: | (Output) | character data |
Returns
Description
Append a string to a character data node
See Also
See other functions in this section
Availability
In release 6.4.0
Insert a string at position offset
Synopsis
Prototype
void ajDomCharacterDataInsertData (
AjPDomCharacterData data,
ajint offset,
const AjPStr arg
);
Type | Name | Read/Write | Description |
AjPDomCharacterData | data | Output | character data |
ajint | offset | Input | offset |
const AjPStr | arg | Input | string |
void | | RETURN | |
Input
offset: | (Input) | offset |
arg: | (Input) | string |
Output
data: | (Output) | character data |
Returns
Description
Insert a string at position offset
See Also
See other functions in this section
Availability
In release 6.4.0
Insert a string at position offset
Synopsis
Prototype
void ajDomCharacterDataInsertDataC (
AjPDomCharacterData data,
ajint offset,
const char* arg
);
Type | Name | Read/Write | Description |
AjPDomCharacterData | data | Output | character data |
ajint | offset | Input | offset |
const char* | arg | Input | string |
void | | RETURN | |
Input
offset: | (Input) | offset |
arg: | (Input) | string |
Output
data: | (Output) | character data |
Returns
Description
Insert a string at position offset
See Also
See other functions in this section
Availability
In release 6.4.0
Remove at most count characters of position offset
Synopsis
Prototype
void ajDomCharacterDataDeleteData (
AjPDomCharacterData data,
ajint offset,
ajint count
);
Type | Name | Read/Write | Description |
AjPDomCharacterData | data | Output | character data |
ajint | offset | Input | offset |
ajint | count | Input | count |
void | | RETURN | |
Input
offset: | (Input) | offset |
count: | (Input) | count |
Output
data: | (Output) | character data |
Returns
Description
Remove at most count characters of position offset
See Also
See other functions in this section
Availability
In release 6.4.0
Replace offset/count characters with a string
Synopsis
Prototype
void ajDomCharacterDataReplaceData (
AjPDomCharacterData data,
ajint offset,
ajint count,
const AjPStr arg
);
Type | Name | Read/Write | Description |
AjPDomCharacterData | data | Output | character data |
ajint | offset | Input | offset |
ajint | count | Input | count |
const AjPStr | arg | Input | replacement string |
void | | RETURN | |
Input
offset: | (Input) | offset |
count: | (Input) | count |
arg: | (Input) | replacement string |
Output
data: | (Output) | character data |
Returns
Description
Replace offset/count characters with a string
See Also
See other functions in this section
Availability
In release 6.4.0
Replace offset/count characters with a string
Synopsis
Prototype
void ajDomCharacterDataReplaceDataC (
AjPDomCharacterData data,
ajint offset,
ajint count,
const char* arg
);
Type | Name | Read/Write | Description |
AjPDomCharacterData | data | Output | character data |
ajint | offset | Input | offset |
ajint | count | Input | count |
const char* | arg | Input | replacement string |
void | | RETURN | |
Input
offset: | (Input) | offset |
count: | (Input) | count |
arg: | (Input) | replacement string |
Output
data: | (Output) | character data |
Returns
Description
Replace offset/count characters with a string
See Also
See other functions in this section
Availability
In release 6.4.0
Return length of character data
Synopsis
Prototype
ajint ajDomCharacterDataGetLength (
const AjPDomCharacterData data
);
Type | Name | Read/Write | Description |
const AjPDomCharacterData | data | Input | character data |
ajint | | RETURN | length |
Input
data: | (Input) | character data |
Returns
Description
Return length of character data
See Also
See other functions in this section
Availability
In release 6.4.0
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
);
Type | Name | Read/Write | Description |
AjPDomText | text | Output | text |
ajint | offset | Input | offset |
AjPDomText | | RETURN | remainder node or NULL |
Input
Output
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
Create a document element
Synopsis
Prototype
AjPDomElement ajDomDocumentCreateElement (
AjPDomDocument doc,
const AjPStr tagname
);
Type | Name | Read/Write | Description |
AjPDomDocument | doc | Output | document |
const AjPStr | tagname | Input | tagname |
AjPDomElement | | RETURN | element |
Input
Output
Returns
Description
Create a document element
See Also
See other functions in this section
Availability
In release 6.4.0
Create a document element
Synopsis
Prototype
AjPDomElement ajDomDocumentCreateElementC (
AjPDomDocument doc,
const char* tagname
);
Type | Name | Read/Write | Description |
AjPDomDocument | doc | Output | document |
const char* | tagname | Input | tagname |
AjPDomElement | | RETURN | element |
Input
Output
Returns
Description
Create a document element
See Also
See other functions in this section
Availability
In release 6.4.0
Create an empty document fragment
Synopsis
Prototype
AjPDomDocumentFragment ajDomDocumentCreateDocumentFragment (
AjPDomDocument doc
);
Type | Name | Read/Write | Description |
AjPDomDocument | doc | Output | document |
AjPDomDocumentFragment | | RETURN | fragment |
Output
Returns
AjPDomDocumentFragment: | fragment |
Description
Create an empty document fragment
See Also
See other functions in this section
Availability
In release 6.4.0
Create a text node
Synopsis
Prototype
AjPDomText ajDomDocumentCreateTextNode (
AjPDomDocument doc,
const AjPStr data
);
Type | Name | Read/Write | Description |
AjPDomDocument | doc | Output | document |
const AjPStr | data | Input | text |
AjPDomText | | RETURN | text node |
Input
Output
Returns
Description
Create a text node
See Also
See other functions in this section
Availability
In release 6.4.0
Create a text node
Synopsis
Prototype
AjPDomText ajDomDocumentCreateTextNodeC (
AjPDomDocument doc,
const char* data
);
Type | Name | Read/Write | Description |
AjPDomDocument | doc | Output | document |
const char* | data | Input | text |
AjPDomText | | RETURN | text node |
Input
Output
Returns
Description
Create a text node
See Also
See other functions in this section
Availability
In release 6.4.0
Create a comment node
Synopsis
Prototype
AjPDomComment ajDomDocumentCreateComment (
AjPDomDocument doc,
const AjPStr data
);
Type | Name | Read/Write | Description |
AjPDomDocument | doc | Output | document |
const AjPStr | data | Input | text |
AjPDomComment | | RETURN | comment node |
Input
Output
Returns
AjPDomComment: | comment node |
Description
Create a comment node
See Also
See other functions in this section
Availability
In release 6.4.0
Create a comment node
Synopsis
Prototype
AjPDomComment ajDomDocumentCreateCommentC (
AjPDomDocument doc,
const char* data
);
Type | Name | Read/Write | Description |
AjPDomDocument | doc | Output | document |
const char* | data | Input | text |
AjPDomComment | | RETURN | comment node |
Input
Output
Returns
AjPDomComment: | comment node |
Description
Create a comment node
See Also
See other functions in this section
Availability
In release 6.4.0
Create a CDATA section
Synopsis
Prototype
AjPDomCDATASection ajDomDocumentCreateCDATASection (
AjPDomDocument doc,
const AjPStr data
);
Type | Name | Read/Write | Description |
AjPDomDocument | doc | Output | document |
const AjPStr | data | Input | text |
AjPDomCDATASection | | RETURN | comment node |
Input
Output
Returns
AjPDomCDATASection: | comment node |
Description
Create a CDATA section
See Also
See other functions in this section
Availability
In release 6.4.0
Create a CDATA section
Synopsis
Prototype
AjPDomCDATASection ajDomDocumentCreateCDATASectionC (
AjPDomDocument doc,
const char* data
);
Type | Name | Read/Write | Description |
AjPDomDocument | doc | Output | document |
const char* | data | Input | text |
AjPDomCDATASection | | RETURN | comment node |
Input
Output
Returns
AjPDomCDATASection: | comment node |
Description
Create a CDATA section
See Also
See other functions in this section
Availability
In release 6.4.0
Create an attribute node
Synopsis
Prototype
AjPDomAttr ajDomDocumentCreateAttribute (
AjPDomDocument doc,
const AjPStr name
);
Type | Name | Read/Write | Description |
AjPDomDocument | doc | Output | document |
const AjPStr | name | Input | text |
AjPDomAttr | | RETURN | attribute node |
Input
Output
Returns
AjPDomAttr: | attribute node |
Description
Create an attribute node
See Also
See other functions in this section
Availability
In release 6.4.0
Create an attribute node
Synopsis
Prototype
AjPDomAttr ajDomDocumentCreateAttributeC (
AjPDomDocument doc,
const char* name
);
Type | Name | Read/Write | Description |
AjPDomDocument | doc | Output | document |
const char* | name | Input | text |
AjPDomAttr | | RETURN | attribute node |
Input
Output
Returns
AjPDomAttr: | attribute node |
Description
Create an attribute node
See Also
See other functions in this section
Availability
In release 6.4.0
Create an entity reference node
Synopsis
Prototype
AjPDomEntityReference ajDomDocumentCreateEntityReference (
AjPDomDocument doc,
const AjPStr name
);
Type | Name | Read/Write | Description |
AjPDomDocument | doc | Output | document |
const AjPStr | name | Input | text |
AjPDomEntityReference | | RETURN | entity reference node |
Input
Output
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
Create an entity reference node
Synopsis
Prototype
AjPDomEntityReference ajDomDocumentCreateEntityReferenceC (
AjPDomDocument doc,
const char* name
);
Type | Name | Read/Write | Description |
AjPDomDocument | doc | Output | document |
const char* | name | Input | text |
AjPDomEntityReference | | RETURN | entity reference node |
Input
Output
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
Create a processing instruction node
Synopsis
Prototype
AjPDomPi ajDomDocumentCreateProcessingInstruction (
AjPDomDocument doc,
const AjPStr target,
const AjPStr data
);
Type | Name | Read/Write | Description |
AjPDomDocument | doc | Output | document |
const AjPStr | target | Input | target |
const AjPStr | data | Input | data |
AjPDomPi | | RETURN | entity reference node |
Input
target: | (Input) | target |
data: | (Input) | data |
Output
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
Create a processing instruction node
Synopsis
Prototype
AjPDomPi ajDomDocumentCreateProcessingInstructionC (
AjPDomDocument doc,
const char* target,
const char* data
);
Type | Name | Read/Write | Description |
AjPDomDocument | doc | Output | document |
const char* | target | Input | target |
const char* | data | Input | data |
AjPDomPi | | RETURN | entity reference node |
Input
target: | (Input) | target |
data: | (Input) | data |
Output
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
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
);
Type | Name | Read/Write | Description |
AjPDomDocument | doc | Modify | document |
const AjPStr | name | Input | name |
AjPDomNodeList | | RETURN | node list |
Input
Input & Output
Returns
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
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
);
Type | Name | Read/Write | Description |
AjPDomDocument | doc | Modify | document |
const char* | name | Input | name |
AjPDomNodeList | | RETURN | node list |
Input
Input & Output
Returns
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
Get document type
Synopsis
Prototype
AjPDomDocumentType ajDomDocumentGetDoctype (
const AjPDomDocument doc
);
Type | Name | Read/Write | Description |
const AjPDomDocument | doc | Input | document |
AjPDomDocumentType | | RETURN | doctype |
Input
Returns
AjPDomDocumentType: | doctype |
Description
Get document type
See Also
See other functions in this section
Availability
In release 6.4.0
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
);
Type | Name | Read/Write | Description |
const AjPDomDocument | doc | Input | document |
AjPDomElement | | RETURN | root element |
Input
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
Print a node with indentation
Synopsis
Prototype
void ajDomPrintNode (
const AjPDomNode node,
ajint indent
);
Type | Name | Read/Write | Description |
const AjPDomNode | node | Input | node |
ajint | indent | Input | indentation |
void | | RETURN | |
Input
node: | (Input) | node |
indent: | (Input) | indentation |
Returns
Description
Print a node with indentation
See Also
See other functions in this section
Availability
In release 6.4.0
Print a node with zero indentation
Synopsis
Prototype
void ajDomPrintNode2 (
const AjPDomNode node
);
Type | Name | Read/Write | Description |
const AjPDomNode | node | Input | node |
void | | RETURN | |
Input
Returns
Description
Print a node with zero indentation
See Also
See other functions in this section
Availability
In release 6.4.0
Print a node internals
Synopsis
Prototype
void ajDomNodePrintNode (
const AjPDomNode node
);
Type | Name | Read/Write | Description |
const AjPDomNode | node | Input | node |
void | | RETURN | |
Input
Returns
Description
Print a node internals
See Also
See other functions in this section
Availability
In release 6.4.0
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
);
Type | Name | Read/Write | Description |
AjPDomNode | node | Output | node |
AjPDomNode | newchild | Modify | node to insert |
AjPDomNode | refchild | Modify | node to insert before |
AjPDomNode | | RETURN | inserted node |
Output
Input & Output
newchild: | (Modify) | node to insert |
refchild: | (Modify) | node to insert before |
Returns
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
Insert newchild into list directly before the existing child refchild.
Synopsis
Prototype
AjPDomNodeEntry ajDomNodeListInsert (
AjPDomNodeList list,
AjPDomNode newchild,
AjPDomNode refchild
);
Type | Name | Read/Write | Description |
AjPDomNodeList | list | Modify | list |
AjPDomNode | newchild | Modify | node to insert |
AjPDomNode | refchild | Modify | node to insert before |
AjPDomNodeEntry | | RETURN | inserted 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
Replace oldchild with newchild in the list of children.
Synopsis
Prototype
AjPDomNode ajDomNodeReplaceChild (
AjPDomNode node,
AjPDomNode newchild,
AjPDomNode oldchild
);
Type | Name | Read/Write | Description |
AjPDomNode | node | Modify | node |
AjPDomNode | newchild | Modify | node to insert |
AjPDomNode | oldchild | Modify | node to replace |
AjPDomNode | | RETURN | oldchild node |
Input & Output
node: | (Modify) | node |
newchild: | (Modify) | node to insert |
oldchild: | (Modify) | node to replace |
Returns
Description
Replace oldchild with newchild in the list of children.
See Also
See other functions in this section
Availability
In release 6.4.0
Replace oldchild with newchild in a node list.
Synopsis
Prototype
AjPDomNodeEntry ajDomNodeListReplace (
AjPDomNodeList list,
AjPDomNode newchild,
AjPDomNode oldchild
);
Type | Name | Read/Write | Description |
AjPDomNodeList | list | Modify | list |
AjPDomNode | newchild | Modify | node to insert |
AjPDomNode | oldchild | Modify | node to replace |
AjPDomNodeEntry | | RETURN | inserted 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
Clone node
Synopsis
Prototype
AjPDomNode ajDomNodeCloneNode (
AjPDomNode node,
AjBool deep
);
Type | Name | Read/Write | Description |
AjPDomNode | node | Modify | node to clone |
AjBool | deep | Input | do a deep clone |
AjPDomNode | | RETURN | clone |
Input
deep: | (Input) | do a deep clone |
Input & Output
node: | (Modify) | node to clone |
Returns
Description
Clone node
See Also
See other functions in this section
Availability
In release 6.4.0
Check whether a node has any children
Synopsis
Prototype
AjBool ajDomNodeHasChildNodes (
const AjPDomNode node
);
Type | Name | Read/Write | Description |
const AjPDomNode | node | Input | node to clone |
AjBool | | RETURN | true if children |
Input
node: | (Input) | node to clone |
Returns
Description
Check whether a node has any children
See Also
See other functions in this section
Availability
In release 6.4.0
Write XML from memory
Synopsis
Prototype
ajint ajDomWrite (
const AjPDomDocument node,
AjPFile outf
);
Type | Name | Read/Write | Description |
const AjPDomDocument | node | Input | document to write |
AjPFile | outf | Modify | output file |
ajint | | RETURN | zero OK, negative if error |
Input
node: | (Input) | document to write |
Input & Output
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
Write XML from memory
Synopsis
Prototype
ajint ajDomWriteIndent (
const AjPDomDocument node,
AjPFile outf,
ajint indent
);
Type | Name | Read/Write | Description |
const AjPDomDocument | node | Input | document to write |
AjPFile | outf | Modify | output file |
ajint | indent | Input | indent level |
ajint | | RETURN | zero OK, negative if error |
Input
node: | (Input) | document to write |
indent: | (Input) | indent level |
Input & Output
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
Read XML into memory from a file pointer
Synopsis
Prototype
ajint ajDomReadFp (
AjPDomDocument node,
FILE* stream
);
Type | Name | Read/Write | Description |
AjPDomDocument | node | Modify | document to write |
FILE* | stream | Modify | stream |
ajint | | RETURN | zero 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
Read XML into memory from a file pointer
Synopsis
Prototype
ajint ajDomReadFilebuff (
AjPDomDocument node,
AjPFilebuff buff
);
Type | Name | Read/Write | Description |
AjPDomDocument | node | Modify | document to write |
AjPFilebuff | buff | Modify | File buffer |
ajint | | RETURN | zero 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
Read XML into memory from a string
Synopsis
Prototype
ajint ajDomReadString (
AjPDomDocument node,
AjPStr str
);
Type | Name | Read/Write | Description |
AjPDomDocument | node | Modify | document to write |
AjPStr | str | Modify | XML string |
ajint | | RETURN | zero 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
Return the text from a text node
Synopsis
Prototype
AjPStr ajDomTextGetText (
AjPDomText text
);
Type | Name | Read/Write | Description |
AjPDomText | text | Output | text |
AjPStr | | RETURN | text or NULL |
Output
Returns
Description
Return the text from a text node
See Also
See other functions in this section
Availability
In release 6.4.0
Return the text from an element node
Synopsis
Prototype
AjPStr ajDomElementGetText (
AjPDomElement element
);
Type | Name | Read/Write | Description |
AjPDomElement | element | Output | element |
AjPStr | | RETURN | text or NULL |
Output
Returns
Description
Return the text from an element node
See Also
See other functions in this section
Availability
In release 6.4.0
Returns the nth child of a named element
Synopsis
Prototype
AjPDomElement ajDomElementGetNthChildByTagNameC (
AjPDomDocument doc,
AjPDomElement element,
const char* name,
ajint n
);
Type | Name | Read/Write | Description |
AjPDomDocument | doc | Modify | doc |
AjPDomElement | element | Modify | element |
const char* | name | Input | element name |
ajint | n | Input | number of child to get |
AjPDomElement | | RETURN | child 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
Returns the 1st child of a named element
Synopsis
Prototype
AjPDomElement ajDomElementGetFirstChildByTagNameC (
AjPDomDocument doc,
AjPDomElement element,
const char* name
);
Type | Name | Read/Write | Description |
AjPDomDocument | doc | Modify | doc |
AjPDomElement | element | Modify | element |
const char* | name | Input | element name |
AjPDomElement | | RETURN | child or NULL |
Input
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