diff --git a/nselib/slaxml.lua b/nselib/slaxml.lua index d3be644fc..e26e7b29d 100644 --- a/nselib/slaxml.lua +++ b/nselib/slaxml.lua @@ -37,51 +37,56 @@ -- DOM Table Features -- -- Document - the root table returned from the parseDOM() method. --- doc.type : the string "document" --- doc.name : the string "#doc" --- doc.kids : an array table of child processing instructions, the root element, and comment nodes. --- doc.root : the root element for the document +-- +-- * doc.type : the string "document" +-- * doc.name : the string "#doc" +-- * doc.kids : an array table of child processing instructions, the root element, and comment nodes. +-- * doc.root : the root element for the document -- -- Element -- --- someEl.type : the string "element" --- someEl.name : the string name of the element (without any namespace prefix) --- someEl.nsURI : the namespace URI for this element; nil if no namespace is applied --- someEl.attr : a table of attributes, indexed by name and index +-- * someEl.type : the string "element" +-- * someEl.name : the string name of the element (without any namespace prefix) +-- * someEl.nsURI : the namespace URI for this element; nil if no namespace is applied +-- * someEl.attr : a table of attributes, indexed by name and index +-- -- local value = someEl.attr['attribute-name'] : any namespace prefix of the attribute is not part of the name +-- -- local someAttr = someEl.attr[1] : an single attribute table (see below); useful for iterating all -- attributes of an element, or for disambiguating attributes with the same name in different namespaces --- someEl.kids : an array table of child elements, text nodes, comment nodes, and processing instructions --- someEl.el : an array table of child elements only --- someEl.parent : reference to the parent element or document table +-- +-- * someEl.kids : an array table of child elements, text nodes, comment nodes, and processing instructions +-- * someEl.el : an array table of child elements only +-- * someEl.parent : reference to the parent element or document table -- -- Attribute -- --- someAttr.type : the string "attribute" --- someAttr.name : the name of the attribute (without any namespace prefix) --- someAttr.value : the string value of the attribute (with XML and numeric entities unescaped) --- someAttr.nsURI : the namespace URI for the attribute; nil if no namespace is applied --- someAttr.parent : reference to the owning element table +-- * someAttr.type : the string "attribute" +-- * someAttr.name : the name of the attribute (without any namespace prefix) +-- * someAttr.value : the string value of the attribute (with XML and numeric entities unescaped) +-- * someAttr.nsURI : the namespace URI for the attribute; nil if no namespace is applied +-- * someAttr.parent : reference to the owning element table -- -- Text - for both CDATA and normal text nodes --- someText.type : the string "text" --- someText.name : the string "#text" --- someText.value : the string content of the text node (with XML and numeric entities unescaped for non-CDATA elements) --- someText.parent : reference to the parent element table +-- +-- * someText.type : the string "text" +-- * someText.name : the string "#text" +-- * someText.value : the string content of the text node (with XML and numeric entities unescaped for non-CDATA elements) +-- * someText.parent : reference to the parent element table -- -- Comment -- --- someComment.type : the string "comment" --- someComment.name : the string "#comment" --- someComment.value : the string content of the attribute --- someComment.parent : reference to the parent element or document table +-- * someComment.type : the string "comment" +-- * someComment.name : the string "#comment" +-- * someComment.value : the string content of the attribute +-- * someComment.parent : reference to the parent element or document table -- -- Processing Instruction -- --- someComment.type : the string "pi" --- someComment.name : the string name of the PI, e.g. has a name of "foo" --- someComment.value : the string content of the PI, i.e. everything but the name --- someComment.parent : reference to the parent element or document table +-- * someComment.type : the string "pi" +-- * someComment.name : the string name of the PI, e.g. has a name of "foo" +-- * someComment.value : the string content of the PI, i.e. everything but the name +-- * someComment.parent : reference to the parent element or document table -- -- @author {"Gavin Kistner", "Gyanendra Mishra"}