deprecated/buildtools/buildsystemtools/lib/XML/DOM/Text.pod
author lorewang
Thu, 11 Nov 2010 11:26:32 +0800
changeset 677 44e49837144a
parent 655 3f65fd25dfd4
permissions -rw-r--r--
update release info
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::Text - A piece of XML text in XML::DOM
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::Text extends L<XML::DOM::CharacterData>, which extends
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     8
L<XML::DOM::Node>.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     9
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    10
The Text interface represents the textual content (termed character
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    11
data in XML) of an Element or Attr. If there is no markup inside an
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    12
element's content, the text is contained in a single object
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    13
implementing the Text interface that is the only child of the element.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    14
If there is markup, it is parsed into a list of elements and Text nodes
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    15
that form the list of children of the element.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    16
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    17
When a document is first made available via the DOM, there is only one
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    18
Text node for each block of text. Users may create adjacent Text nodes
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    19
that represent the contents of a given element without any intervening
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    20
markup, but should be aware that there is no way to represent the
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    21
separations between these nodes in XML or HTML, so they will not (in
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    22
general) persist between DOM editing sessions. The normalize() method
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    23
on Element merges any such adjacent Text objects into a single node for
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    24
each block of text; this is recommended before employing operations
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    25
that depend on a particular document structure, such as navigation with
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    26
XPointers.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    27
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    28
=head2 METHODS
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    29
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    30
=over 4
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    31
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    32
=item splitText (offset)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    33
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    34
Breaks this Text node into two Text nodes at the specified
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    35
offset, keeping both in the tree as siblings. This node then
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    36
only contains all the content up to the offset point. And a
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    37
new Text node, which is inserted as the next sibling of this
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    38
node, contains all the content at and after the offset point.
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>  The offset at which to split, starting from 0.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    42
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    43
Return Value: The new Text node.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    44
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    45
DOMExceptions:
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    46
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    47
=over 4
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    48
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    49
=item * INDEX_SIZE_ERR
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    50
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    51
Raised if the specified offset is negative or greater than the number of 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    52
characters in data.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    53
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    54
=item * NO_MODIFICATION_ALLOWED_ERR
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    55
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    56
Raised if this node is readonly.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    57
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    58
=back
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    59
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    60
=back