XML, OpenOffice & Perl

Discussion in 'XML' started by =?ISO-8859-15?Q?Jean-Marie_Gouarn=E9?=, Aug 5, 2004.

  1. 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
     
    =?ISO-8859-15?Q?Jean-Marie_Gouarn=E9?=, Aug 5, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. P. Flavin
    Replies:
    0
    Views:
    481
    P. Flavin
    Sep 16, 2003
  2. Nerim
    Replies:
    0
    Views:
    402
    Nerim
    Sep 26, 2003
  3. Ellinghaus, Lance

    Modules to create XML for OpenOffice

    Ellinghaus, Lance, Apr 29, 2004, in forum: Python
    Replies:
    1
    Views:
    293
  4. Replies:
    1
    Views:
    262
    Peter Hansen
    Jan 11, 2006
  5. Tony
    Replies:
    2
    Views:
    392
Loading...

Share This Page