XML Representation
Each XML stanza is represented as the following tuple:
XMLElement = {xmlelement, Name, Attrs, [ElementOrCDATA]}
Name = string()
Attrs = [Attr]
Attr = {Key, Val}
Key = string()
Val = string()
ElementOrCDATA = XMLElement | CDATA
CDATA = {xmlcdata, string()}
E. g. this stanza:
<message to='test@conference.example.org' type='groupchat'>
<body>test</body>
</message>
is represented as the following structure:
{xmlelement, "message",
[{"to", "test@conference.example.org"},
{"type", "groupchat"}],
[{xmlelement, "body",
[],
[{xmlcdata, "test"}]}]}}
没有评论:
发表评论