| MsOffice::Word::Surgeon::Text(3pm) | User Contributed Perl Documentation | MsOffice::Word::Surgeon::Text(3pm) |
MsOffice::Word::Surgeon::Text - internal representation for a node of literal text
This is used internally by MsOffice::Word::Surgeon for storing a chunk of literal text in a MsWord document. It loosely corresponds to a "<w:t>" node in OOXML, but may also contain an anonymous XML fragment which is the part of the document just before the "<w:t>" node -- used for reconstructing the complete document after having changed the contents of some text nodes.
my $text_node = MsOffice::Word::Surgeon::Text(
xml_before => $xml_string,
literal_text => $text_string,
);
Constructor for a new text object. Arguments are :
my $xml = $text_node->as_xml;
Returns the XML representation of that text node. The attribute "xml:space="preserve"" is automatically added if the literal text starts of ends with a space character.
$text_node->merge($next_text_node);
Merge the contents of $next_text_node together with the current text node. This is only possible if the next text node has an empty "xml_before" attribute; if this condition is not met, an exception is raised.
my $xml = $text_node->replace($pattern, $replacement_callback, %args);
Replaces all occurrences of $pattern within the text node by a new string computed by $replacement_callback, and returns a new xml string corresponding to the result of all these replacements. This is the internal implementation for public method "replace" in MsOffice::Word::Surgeon.
Puts the literal text within the node into uppercase letters.
Laurent Dami, <dami AT cpan DOT org<gt>
Copyright 2019-2024 by Laurent Dami.
This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.
| 2025-05-16 | perl v5.40.1 |