term2xml/3

Converts a highlevel representation of a XML element to is lowlevel representation.

term2xml(+ElementType, +Term, ?XmlTerm)

term2xml/3 converts the highlevel representation of a XML term to its lowlevel format (as it is needed by write_xml/1/2). This conversion maps term arguments to attributes and subelements and converts basic data to atoms.

Arguments

ElementType         type description of a XML element
Term                high level representation of the XML term
XmlTerm             term representing an XML term

Examples

term2xml(
    n1(n2(-atom), a2 = number, a1 = integer, n3(a3 = atom)),
    n1(n2(hello), 1.0, 0, n3(z)),
    XmlTerm).

->

XmlTerm = element(n1, [a1 = '0', a2 = '1.0'], [ element(n2, [], [chardata('hello')]), element(n3, [a3 = 'z'], [])])

Standard

This predicate is not part of the ISO-Prolog Standard.

See also

read_xml/2/3, write_xml/1/2, term2xml/3, term2xmldoc/3, xml2term/3, xmldoc2term/3.


Up read on...