The xml
module is an extension module, and provides functions to manipulate XML documents: reading nodes, and changing nodes and properties. Creating XML documents is done by other modules, such as idmef
or iodef
.
Configuration options
None.
Primitives
xml_get_str
:xmldoc
,str
→str
get value from a node in an XML document- usage:
xml_get_str
(xml-document, path)
fetches value of node referenced by path in xml-document - returns: a string, if path is a valid XPath path in xml-document, the undefined null object otherwise
- usage:
xml_set_str
:xmldoc
,str
,str
→int
set node value in an XML document, creating it if necessary- usage:
xml_set_str
(xml-document, path, value)
sets value of node referenced by path in xml-document to value - returns: 1 (true) if path is a valid XPath path in xml-document, 0 (false) otherwise
- usage:
xml_set_prop
:xmldoc
,str
,str
,str
→int
set node property (a.k.a., attribute) in an XML document, creating it if necessary- usage:
xml_set_prop
(xml-document, path, property, value)
sets property property of node referenced by path in xml-document to value - returns: 1 (true) if path is a valid XPath path in xml-document, 0 (false) otherwise
- usage: