Macaulay2 » Documentation
Packages » XML :: xmlAddText(LibxmlNode,String)
next | previous | forward | backward | up | index | toc

xmlAddText(LibxmlNode,String) -- add text to an XML node

Synopsis

Description

i1 : n = xmlParse ///<bar id="foo" name="too"></bar>///

o1 = <bar id="foo" name="too"/>

o1 : LibxmlNode (xmlTypeDescription)
i2 : xmlAddText(n,"hi there")

o2 = "hi there"

o2 : LibxmlNode (xmlTypeDescription)
i3 : xmlIsText oo

o3 = true
i4 : n

o4 = <bar id="foo" name="too">hi there</bar>

o4 : LibxmlNode (xmlTypeDescription)

Caveat

The list of children should not contain two adjacent text nodes.

Ways to use this method: