.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "XML::DOM::CharacterData 3pm" .TH XML::DOM::CharacterData 3pm "2022-10-14" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" XML::DOM::CharacterData \- Common interface for Text, CDATASections and Comments .SH "DESCRIPTION" .IX Header "DESCRIPTION" XML::DOM::CharacterData extends XML::DOM::Node .PP The CharacterData interface extends Node with a set of attributes and methods for accessing character data in the \s-1DOM.\s0 For clarity this set is defined here rather than on each object that uses these attributes and methods. No \s-1DOM\s0 objects correspond directly to CharacterData, though Text, Comment and CDATASection do inherit the interface from it. All offsets in this interface start from 0. .SS "\s-1METHODS\s0" .IX Subsection "METHODS" .IP "getData and setData (data)" 4 .IX Item "getData and setData (data)" The character data of the node that implements this interface. The \s-1DOM\s0 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. .IP "getLength" 4 .IX Item "getLength" The number of characters that are available through data and the substringData method below. This may have the value zero, i.e., CharacterData nodes may be empty. .IP "substringData (offset, count)" 4 .IX Item "substringData (offset, count)" Extracts a range of data from the node. .Sp Parameters: \fIoffset\fR Start offset of substring to extract. \fIcount\fR The number of characters to extract. .Sp Return Value: The specified substring. If the sum of offset and count exceeds the length, then all characters to the end of the data are returned. .IP "appendData (str)" 4 .IX Item "appendData (str)" Appends 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. .IP "insertData (offset, arg)" 4 .IX Item "insertData (offset, arg)" Inserts a string at the specified character offset. .Sp Parameters: \fIoffset\fR The character offset at which to insert. \fIarg\fR The DOMString to insert. .IP "deleteData (offset, count)" 4 .IX Item "deleteData (offset, count)" Removes a range of characters from the node. Upon success, data and length reflect the change. If the sum of offset and count exceeds length then all characters from offset to the end of the data are deleted. .Sp Parameters: \fIoffset\fR The offset from which to remove characters. \fIcount\fR The number of characters to delete. .IP "replaceData (offset, count, arg)" 4 .IX Item "replaceData (offset, count, arg)" Replaces the characters starting at the specified character offset with the specified string. .Sp Parameters: \fIoffset\fR The offset from which to start replacing. \fIcount\fR The number of characters to replace. \fIarg\fR The DOMString with which the range must be replaced. .Sp If the sum of offset and count exceeds length, then all characters to the end of the data are replaced (i.e., the effect is the same as a remove method call with the same range, followed by an append method invocation).