Class Comment
XML DOM Comment AND CharacterData Interface.
The CharacterData does not have its own node-type in DOM2 specs, hence we simply use the Comment class, since that class inherits from CharacterData, but doesn't add anything.
CharacterData is not its own class/type (no type-constant defined), and since a Comment type doesn't add anything to the CharacterData, we actually use the Comment type also as the base for CharacterData derivatives such as Text and CDATASection.
See the Comment, the CharacterData, and Node interfaces.
Functions
CharacterData:appendData (arg) | Appends data, implements appendData. |
CharacterData:deleteData (offset, count) | Deletes data, implements deleteData. |
CharacterData:insertData (offset, arg) | Inserts data, implements insertData. |
CharacterData:replaceData (offset, count, arg) | Replaces data, implements replaceData. |
CharacterData:substringData (offset, count) | Gets a substring, implements substringData. |
Tables
Comment.properties | Properties of the Comment class, beyond the Node class |
Methods
Comment:write (buffer) | exports the XML. |
Functions
- CharacterData:appendData (arg)
-
Appends data, implements appendData.
Parameters:
- arg string the data to append
Returns:
-
nothing
- CharacterData:deleteData (offset, count)
-
Deletes data, implements deleteData.
Indices 1-indexed, and based on UTF-8 characters, not bytes.
Parameters:
- offset int start character
- count int number of characters to delete
Returns:
-
true or nil+err
- CharacterData:insertData (offset, arg)
-
Inserts data, implements insertData.
Indices 1-indexed, and based on UTF-8 characters, not bytes.
Parameters:
- offset int start character
- arg string the data to insert
Returns:
-
true or nil+err
- CharacterData:replaceData (offset, count, arg)
-
Replaces data, implements replaceData.
Indices 1-indexed, and based on UTF-8 characters, not bytes.
Parameters:
- offset int start character
- count int number of characters to delete
- arg string the data to insert
Returns:
-
true or nil+err
- CharacterData:substringData (offset, count)
-
Gets a substring, implements substringData.
Indices 1-indexed, and based on UTF-8 characters, not bytes.
Parameters:
- offset int start character
- count int number of characters to return
Returns:
-
true or nil+err
Tables
- Comment.properties
-
Properties of the Comment class, beyond the Node class
Fields:
- data (string) the comment data
- length
(int) the length of the
data
in UTF-8 characters (readonly) - nodeValue
(string) same as field
data
(readonly)