OpenOffice::OODoc::Notes - Notes of the OpenOffice::OODoc man pages
The OpenOffice::OODoc::Notes page contains all the notes corresponding to the "[nn]" note citations included in the other documents.
 In fact in this case a more complex (but hidden) operation is
carried out: firstly it writes to a temporary file and if no error
occurs, the source file is deleted and its name given to the
temporary file. OODoc::File never writes directly to the source
 For example, the pair ('/office:body/text:p', 12) or
('//text:p', 12) represent, in an OpenOffice.org document, the
thirteenth occurrence of the 'text:p' element or the 13th paragraph
of text (XPath occurrences are numbered table elements in Perl,
starting from 0).
 For example, you can easily copy a paragraph from one document
to another but only if you knowingly modify the paragraph's style
attribute if that style is not already defined in the destination
document. You can also copy the style but only if you are sure that
this style is not already defined by another unknown style in the
destination document (and so on).
 Can also be shortened to ooXPath() if the XPath module is loaded
via the main OODoc module.
 It is just a single element 'office:body' which contains all the
text in an OpenOffice.org document. Therefore, the XPath path
indicating the text is always ('//office:body', 0). Remember that in
the case of an OpenOffice.org text file (Writer), it would be better
to use the appendParagraph method of OODoc::Text as this requires
 "automatic styles" are styles which are not explicitly indicated
in the styles list as it appears to the end user.
 If for any reason you absolutely have to use a non-UTF8 XML
string which contains 8-bit characters (accented letters, etc.), you
can always convert the string using the encode_text method before
passing it to appendElement. Of course, the problem will not arise
if you are absolutely sure that the string only contains ASCII (7
 XML syntax is checked, but it is up to the user to verify that
the element import conforms to OpenOffice.org document syntax.
 OpenOffice.org documents use UTF8 XML encoding.
 In the examples we have looked at, handling of UTF8 strings is
rudimentary but effective in the current version. It appears at
least to generate French accented characters properly. Any potential
contributors who have mastered UTF8 are invited to improve the
implementation of this method.
 See the Perl/Encode manual for the list of supported character
sets. If the user's character set is selected using the
localEncoding() function, any unsupported value (according to the
current Perl installation) is automatically rejected. A list of
accepted encodings can be returned by Encode::encodings(':all')
(the Encode module is loaded by OpenOffice::OODoc, so this function
is always available for the application). Some encodings can be
named using aliases (see the Encode::Alias documentation).
 To do a Find/Replace in an entire text document, use the
selectTextContent(filter, replacement) method in OODoc::Text.
 In the current version, inserting an element imported in XML
can mess up the internal numbering of elements. Such inconsistencies
are only a problem for methods which will later access elements
according to their position. They have no effect on the document's
integrity when updated using save, and do not affect methods which
select elements according to content criteria. A reorganize call
after one or more element insertions imported in XML is normally
enough to re-establish order.
 However, contrary to insertElement, a copy of the given element
is indeed created, not just a reference to it.
 Note: such forced attributes do not upset the function of
OpenOffice.org which ignores them. They could therefore be useful in
programs which handle documents out of reach of the end user.
However, if such a document is then edited or updated by
OpenOffice.org or StarOffice (using currently released versions),
these "foreign" attributes will be lost and the software will
replace what it considers to be the "real" values to those
attributes it manages.
 Remember that in OpenOffice.org document logic, a page break is
not an element but a paragraph attribute. Generally, you insert a
page break by giving a 'page break before' attribute to a paragraph.
This is just one example of the usage of the 'attribute' option.
 See OODoc::Styles module for information about styles.
 'text:p' refers to a paragraph element, just as 'text:h' refers
to a header element.
 Any tables contained in headers and footers belong to the page
layout ('styles.xml') and not the content ('content.xml') of
OpenOffice.org documents. Such tables are therefore ignored by
 For example: if a currency-formatted cell contains 155.12, the
'currency' attribute is set to 'GBP' and the presentation style is
the standard default setting for a British user, the cell's text
would be "£155.12".
 To access a header of a particular level, you need to use
selectElementByAttribute and select the level attribute (see
OODoc::XPath). The name of the level attribute is "text:level" in
OOo documents and "text:outline-level" in OpenDocuments.
 Footnotes are physically inserted into the text at the place
where they are called, just after the link element indicating the
footnote's number. Its display at the foot of the page or elsewhere
is a trick of the graphical interface.
 A call to $element->getName returns the element's XML name
including its namespace prefix e.g. 'text:p' for a paragraph or
'table:table-row' for a row of a table.
 The program function can return quite sophisticated temporary
data which is to be inserted into the text and reused later, again
with this method, in order to do some complex processing in several
 You can easily use getText and setText (getText returns "flat"
text with all style divisions removed) when performing an iteration
on all of a document's elements. This means you can perform search
and replace operations which ignore style divisions. In this case,
however, when you update (setText), any style divisions in the
original element will be lost.
 Obviously, opening a document in OpenOffice.org or StarOffice
which contains references to non-existent styles will give
unpredictable results as to the viewing of the given paragraphs or
 The short form ooImage() is available if the main
OpenOffice::OODoc module is already loaded.
 See OpenOffice::OODoc::Styles for style creation or, better,
OpenOffice::OODoc::Document for image styles.
 OpenOffice.org Writer gives default names to images (e.g.
Image1, Image2, ...) if the user does not deliberately name them.
This is not the case in Impress.
 If you want to know why a background colour is controlled by an
attribute in the "style" namespace when the colour of the characters
is controlled by an attribute in the "fo" namespace, post a question
Copyright 2004-2005 by Genicorp, S.A. (http://www.genicorp.com)
Initial developer: Jean-Marie Gouarne (http://jean.marie.gouarne.online.fr)
Initial English version of the reference manual by Graeme A. Hunter (firstname.lastname@example.org)
- Genicorp General Public Licence v1.0
- GNU Lesser General Public License v2.1
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in '"£155.12".'. Assuming CP1252
To install OpenOffice::OODoc, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.