473,788 Members | 2,897 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XML, OpenOffice & Perl

The new OpenOffice::OOD oc 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 => "spreadshee t"
);

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 createImageElem ent() method has been improved to allow easy image
import in drawing and presentation documents as well as in text or
spreadsheet documents. Ex:

$doc->createImageEle ment
(
"Mountain",
description => "The Kilimanjaro",
page => 3,
position => "4.2cm, 5cm"
size => "3cm, 4cm",
style => "MyGraphics ",
import => "C:\MyImages\Mo untain.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->createTextStyl e
(
"Outstandin g",
properties =>
{
'fo:color' => rgb2oo("dark blue"),
'fo:background-color' => rgb2oo("yellow" )
}
);
# give the colored style to the selected elements
$doc->setStyle($_, "Outstandin g")
for $doc->selectElements ByContent("Open Office");

- 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 1979

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

Similar topics

2
1371
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
1580
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 in OpenOffice. The database currently consists of a single table, located in c:\MySQL\data. The database is CD_Collection; the table name is Album. There is no password associated with the database/table. (I'm just getting started, and wanted...
5
8560
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 support SQL queries to said database? Bob Powell
6
2180
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 site, but know nothing at all about cgi. Basically, I just want people to type the domain they want to look up into a textbox, and then click a button to submit the form.
0
2081
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 second BETHESDA, MD (January 10, 2006) dtSearch Corp., a leading supplier of enterprise and developer text retrieval software, announces Version 7.2 of its product line for instantly searching terabytes of documents across a desktop, network,...
7
3685
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, but it was last updated more than a year ago. Thanks, Ken
7
2253
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 large beast, and interaction is rather complex, I would like to know if there is someone who is willing to share experience (and, possibly, code).
1
4014
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 service.. when am installing openoffice, its just installed as normal as like ms office not a server.. am tried with the code to run as server but not succeed at cmd line code soffice...
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5402
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4074
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2896
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.