Converts a high level representation of a XML document to a low level representation.
xmldoc2term/3 converts the high level representation of a XML document in a low level format. This conversion maps term arguments to attributes and subelements and converts basic data to atoms.
DocType type description of a XML document Term high level representation of the XML term XmlTerm term representing an XML term
term2xmldoc(
n1(n2(-atom), a2 = number, a1 = integer, n3(a3 = atom)),
n1(n2(hello), 1.0, 0, n3(z)),
XmlTerm).
->
XmlTerm =
document(
[xml([version = '1.0'])],
element(n1, [a1 = '0', a2 = '1.0'], [
element(n2, [], [chardata('hello')]),
element(n3, [a3 = 'z'], [])]),
[])
This predicate is not part of the ISO-Prolog Standard.
| scroll to top |
|