pdk.flow.xml.XmlCharacterData
contains functions to operate with XML CharacterData variables
Text strings in the DOM are represented in UTF-16, i.e. as a sequence of 16-bit units. In the following, the term 16-bit units is used whenever necessary to indicate that indexing on CharacterData is done in 16-bit units.
All functions
appendData
Append the string to the end of the character data of the node. Upon success, data provides access to the concatenation of data and the DOMString specified.
Arguments:
characterData :: pdk.net.xml.CharacterData
arg :: pdk.core.String
Result:
No variable is returned. The input characterData has arg data.
Possible exceptions
NullPointerException - throws if the input characterData or arg is
NULLDOMException -
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly
Example:
XML Document
<order id="1">
<book id="b_1">
Harry Potter and the Philosopher's Stone
</book>
</order>attr :: pdk.net.xml.CharacterData = "Harry Potter and the Philosopher's Stone"
arg :: pdk.core.String = " chapter 2"
XmlCharacterData.appendData(attr, arg) :: Void ->
attr = "Harry Potter and the Philosopher's Stone chapter 2"deleteData
Removes a range of 16-bit units from the node. Upon success, data and length reflect the change.
Arguments:
characterData :: pdk.net.xml.CharacterData
offset :: pdk.core.Integer - The offset from which to start removing.
limit :: pdk.core.Integer - The number of 16-bit units to delete. If the sum of
offsetandcountexceedslengththen all 16-bit units fromoffsetto the end of the data are deleted.
Result:
No variable is returned. The input characterData has updated value.
Possible exceptions
NullPointerException - throws if the input characterData or offset or limit is
NULLDOMException -
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly
Example:
XML Document
<order id="1">
<book id="b_1">
Harry Potter and the Philosopher's Stone
</book>
</order>attr :: pdk.net.xml.CharacterData = "Harry Potter and the Philosopher's Stone"
offset :: pdk.core.Integer = 12
limit :: pdk.core.Integer = 3
XmlCharacterData.deleteData(attr, offset, limit) :: Void ->
attr = "Harry Potter the Philosopher's Stone"getData
The character data of the node. The DOM implementation may not put arbitrary limits on the amount of data that may be stored in a CharacterData node. However, implementation limits may mean that the entirety of a node's data may not fit into a single DOMString. In such cases, the user may call substringData to retrieve the data in appropriately sized pieces.
Arguments:
characterData :: pdk.net.xml.CharacterData
Result:
output :: pdk.core.String
Possible exceptions
NullPointerException - throws if the input characterData is
NULLDOMException -
DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in aDOMStringvariable on the implementation platform.
Example:
XML Document
<order id="1">
<book id="b_1">
Harry Potter and the Philosopher's Stone
</book>
</order>attr :: pdk.net.xml.CharacterData = "Harry Potter and the Philosopher's Stone"
XmlCharacterData.getData(attr) :: pdk.core.String ->
output = "Harry Potter and the Philosopher's Stone"getLength
The number of 16-bit units that are available through data and the substringData functions below. This may have the value zero, i.e., CharacterData nodes may be empty.
Arguments:
characterData :: pdk.net.xml.CharacterData
Result:
output :: pdk.core.Integer
Possible exceptions
NullPointerException - throws if the input characterData is
NULL
Example:
XML Document
<order id="1">
<book id="b_1">
Harry Potter and the Philosopher's Stone
</book>
</order>attr :: pdk.net.xml.CharacterData = "Harry Potter and the Philosopher's Stone"
XmlCharacterData.getLength(attr) :: pdk.core.Integer ->
output = 40insertData
Insert a string at the specified 16-bit unit offset.
Arguments:
characterData :: pdk.net.xml.CharacterData
offset :: pdk.core.Integer - The character offset at which to insert.
arg :: pdk.core.String - The
DOMStringto insert.
Result:
No variable is returned. The input characterData has updated value.
Possible exceptions
NullPointerException - throws if the input characterData or offset or arg is
NULLDOMException -
INDEX_SIZE_ERR: Raised if the specifiedoffsetis negative or greater than the number of 16-bit units indata.NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
Example:
XML Document
<order id="1">
<book id="b_1">
Harry Potter and the Philosopher's Stone
</book>
</order>attr :: pdk.net.xml.CharacterData = "Harry Potter Philosopher's Stone"
offset :: pdk.core.Integer = 12
arg :: pdk.core.String = "and the "
XmlCharacterData.insertData(attr, offset, arg) :: Void ->
attr = "Harry Potter and the Philosopher's Stone"replaceData
Replace the characters starting at the specified 16-bit unit offset with the specified string.
Arguments:
characterData :: pdk.net.xml.CharacterData
offset :: pdk.core.Integer - The offset from which to start replacing.
count :: pdk.core.Integer - The number of 16-bit units to replace. If the sum of
offsetandcountexceedslength, then all 16-bit units to the end of the data are replaced; (i.e., the effect is the same as aremovefunction call with the same range, followed by an appendData function invocation).arg :: pdk.core.String - The
DOMStringwith which the range must be replaced.
Result:
No variable is returned. The input characterData has updated value.
Possible exceptions
NullPointerException - throws if the input characterData or offset or arg is
NULLDOMException -
INDEX_SIZE_ERR: Raised if the specifiedoffsetis negative or greater than the number of 16-bit units indata, or if the specifiedcountis negative.NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
Example:
XML Document
<order id="1">
<book id="b_1">
Harry Potter and the Philosopher's Stone
</book>
</order>attr :: pdk.net.xml.CharacterData = "Harry Potter and the Philosopher's Stone"
offset :: pdk.core.Integer = 21
count :: pdk.core.Integer = 19
arg :: pdk.core.String = "Chamber of Secrets"
XmlCharacterData.replaceData(attr, offset, count, arg) :: Void ->
attr = "Harry Potter and the Chamber of Secrets"setData
Sets the character data of the node that implements this interface. The DOM implementation may not put arbitrary limits on the amount of data that may be stored in a CharacterData node.
Arguments:
characterData :: pdk.net.xml.CharacterData
data :: pdk.core.String
Result:
No variable is returned. The input characterData has updated value.
Possible exceptions
NullPointerException - throws if the input characterData or offset or arg is
NULLDOMException -
NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
Example:
XML Document
<order id="1">
<book id="b_1">
Harry Potter and the Philosopher's Stone
</book>
</order>attr :: pdk.net.xml.CharacterData = "Harry Potter and the Philosopher's Stone"
data :: pdk.core.String = "Harry Potter and the Chamber of Secrets"
XmlCharacterData.setData(attr, data) :: Void ->
attr = "Harry Potter and the Chamber of Secrets"substringData
Extracts a range of data from the node.
Arguments:
characterData :: pdk.net.xml.CharacterData
offset :: pdk.core.Integer - Start offset of substring to extract.
count :: pdk.core.Integer - The number of 16-bit units to extract.
Result:
output :: pdk.core.String - The specified substring. If the sum of
offsetandcountexceeds thelength, then all 16-bit units to the end of the data are returned.
Possible exceptions
NullPointerException - throws if the input characterData or offset or arg is
NULLDOMException -
INDEX_SIZE_ERR: Raised if the specifiedoffsetis negative or greater than the number of 16-bit units indata, or if the specifiedcountis negative.DOMSTRING_SIZE_ERR: Raised if the specified range of text does not fit into aDOMString.
Example:
XML Document
<order id="1">
<book id="b_1">
Harry Potter and the Philosopher's Stone
</book>
</order>attr :: pdk.net.xml.CharacterData = "Harry Potter and the Philosopher's Stone"
offset :: pdk.core.Integer = 21
count :: pdk.core.Integer = 19
XmlCharacterData.substringData(attr, offset, count) :: pdk.core.String ->
output = "Philosopher's Stone"Last updated