473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

XML, OpenOffice & Perl

The new OpenOffice::OODoc distribution, V 1.203, is available from CPAN
today.

It's an Expat-based Perl extension allowing direct read/write access to
OpenOffice.org (XML) documents. It provides an object representation of
the OOo documents, with a lot of methods to get, create, update or
delete any content or presentation element, and attempts to hide the
most part of the complex XPath navigation. This toobox is an XML API
that deal with the physical files (compressed XML), and never uses the
OpenOffice.org (or StarOffice) product. It allows document processing
where no desktop software is installed, and requires a Perl 5.8
environment only (so the same scripts can be deployed on Win32, Linux,
Solaris, HP-UX, Mac and other platforms).

The most recent new features are:

- While the previous releases allowed only read/write operations in
previously existing documents, the present one can create new OOo
documents from scratch; the user has just to provide an additional
"create" option giving the document class in the main object
constructor. For ex, to create a new spreadsheet (i.e. OpenOffice Calc)
document that will be stored in a "doc.sxc" file, the constructor is:

my $doc = ooDocument
(
file => "doc.sxc",
create => "spreadsheet"
);

The new documents are generated from a set of XML templates; if needed,
each application can select user-provided templates instead of the
default ones

- The createImageElement() method has been improved to allow easy image
import in drawing and presentation documents as well as in text or
spreadsheet documents. Ex:

$doc->createImageElement
(
"Mountain",
description => "The Kilimanjaro",
page => 3,
position => "4.2cm, 5cm"
size => "3cm, 4cm",
style => "MyGraphics",
import => "C:\MyImages\Mountain.jpg"
);

- The OOo date fields (stored in ISO-8601 format) can be easily
translated to/from Perl localtime() dates, due to new conversion functions;

- Symbolic color names (like "blue" or "yellow") and not only raw
hexadecimal RGB codes, are allowed for text and background colors. So,
to color in dark blue with a yellow background every paragraph or item
matching "OpenOffice" (or any other string or regex), the code is more
readable:

# define the colored style
$doc->createTextStyle
(
"Outstanding",
properties =>
{
'fo:color' => rgb2oo("dark blue"),
'fo:background-color' => rgb2oo("yellow")
}
);
# give the colored style to the selected elements
$doc->setStyle($_, "Outstanding")
for $doc->selectElementsByContent("OpenOffice");

- Bug fixes and functional improvements in the localization; the local
character sets seems to be properly supported; the user's local
character (iso-8859-1 by default) can be selected either at the
installation level or separately in each application.

The previous text-focused methods (search/replace/create/remove) are
unchanged.

Please see http://search.cpan.org/dist/OpenOffice-OODoc for details

Thanks for comments
JMG http://jean.marie.gouarne.online.fr
Jul 20 '05 #1
0 1951

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Allenabethea | last post by:
Is there any advantage to upgrading the python distribution which is part of OpenOffice to 2.3.3? I notice it is version 2.2.2 Are the bug fixes crucial? allen
0
by: Bob M | last post by:
This question is about MySQL and how it can be accessed with OpenOffice (presumably the same issue would arise with MS Office, but I'm not sure about that). The problem I'm having is with the setup...
5
by: Bob Powell | last post by:
Hello everyone: Can anyone tell me if it is possible to connect excel or openoffice via odbc directly to a postgres backend database. Also, if that is possible does either OpenOffice or Excel...
6
by: Mark Rae | last post by:
Hi, I'm not sure if this is the right newsgroup, but here goes... I'm trying to integrate the webwho.zip cgi script from the following site: http://www.webwho.co.uk/ into a standard ASP.NET...
0
by: dtsearch | last post by:
New release expands-through a .NET Spider API, to Linux, and to OpenOffice-dtSearch's ability to index over a terabyte of text in a single index, with indexed search time typically less than a...
7
by: kenneth.m.mcdonald | last post by:
Are then any currently active and reasonably mature Python plugins/ apis/whatever for programming/scripting OpenOffice? The page I've found is http://udk.openoffice.org/python/python-bridge.html,...
7
by: PaoloB | last post by:
Hi everyone, during our development, we need to write some unit tests that interact with OpenOffice through pyUno. Is there anyone who has got any experience on it? As OpenOffice is quite a...
1
by: maheswaran | last post by:
Hi Community, I am using Knowledgetree document management system application, for this i want to install openoffice as service and openoffice as background task.. How i can install openoffice as...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.