deprecated/buildtools/buildsystemtools/lib/XML/DOM/CharacterData.pod
author kelvzhu
Wed, 27 Oct 2010 16:03:51 +0800
changeset 662 60be34e1b006
parent 655 3f65fd25dfd4
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
655
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     1
=head1 NAME
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     2
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     3
XML::DOM::CharacterData - Common interface for Text, CDATASections and Comments
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     4
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     5
=head1 DESCRIPTION
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     6
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     7
XML::DOM::CharacterData extends L<XML::DOM::Node>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     8
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     9
The CharacterData interface extends Node with a set of attributes and
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    10
methods for accessing character data in the DOM. For clarity this set
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    11
is defined here rather than on each object that uses these attributes
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    12
and methods. No DOM objects correspond directly to CharacterData,
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    13
though Text, Comment and CDATASection do inherit the interface from it. 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    14
All offsets in this interface start from 0.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    15
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    16
=head2 METHODS
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    17
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    18
=over 4
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    19
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    20
=item getData and setData (data)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    21
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    22
The character data of the node that implements this
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    23
interface. The DOM implementation may not put arbitrary
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    24
limits on the amount of data that may be stored in a
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    25
CharacterData node. However, implementation limits may mean
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    26
that the entirety of a node's data may not fit into a single
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    27
DOMString. In such cases, the user may call substringData to
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    28
retrieve the data in appropriately sized pieces.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    29
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    30
=item getLength
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    31
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    32
The number of characters that are available through data and
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    33
the substringData method below. This may have the value zero,
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    34
i.e., CharacterData nodes may be empty.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    35
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    36
=item substringData (offset, count)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    37
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    38
Extracts a range of data from the node.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    39
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    40
Parameters:
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    41
 I<offset>  Start offset of substring to extract.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    42
 I<count>   The number of characters to extract.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    43
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    44
Return Value: The specified substring. If the sum of offset and count
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    45
exceeds the length, then all characters to the end of
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    46
the data are returned.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    47
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    48
=item appendData (str)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    49
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    50
Appends the string to the end of the character data of the
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    51
node. Upon success, data provides access to the concatenation
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    52
of data and the DOMString specified.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    53
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    54
=item insertData (offset, arg)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    55
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    56
Inserts a string at the specified character offset.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    57
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    58
Parameters:
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    59
 I<offset>  The character offset at which to insert.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    60
 I<arg>     The DOMString to insert.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    61
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    62
=item deleteData (offset, count)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    63
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    64
Removes a range of characters from the node. 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    65
Upon success, data and length reflect the change.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    66
If the sum of offset and count exceeds length then all characters 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    67
from offset to the end of the data are deleted.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    68
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    69
Parameters: 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    70
 I<offset>  The offset from which to remove characters. 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    71
 I<count>   The number of characters to delete. 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    72
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    73
=item replaceData (offset, count, arg)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    74
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    75
Replaces the characters starting at the specified character
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    76
offset with the specified string.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    77
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    78
Parameters:
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    79
 I<offset>  The offset from which to start replacing.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    80
 I<count>   The number of characters to replace. 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    81
 I<arg>     The DOMString with which the range must be replaced.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    82
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    83
If the sum of offset and count exceeds length, then all characters to the end of
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    84
the data are replaced (i.e., the effect is the same as a remove method call with 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    85
the same range, followed by an append method invocation).
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    86
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    87
=back