Slashdot Mirror


Hacking OpenOffice

prostoalex writes "Peter Sefton appreciates OpenOffice Writer's open and documented XML format and hence tries to customize and configure OO Writer to his own liking. In the article on XML.com he plays with OpenOffice XML, introduces an XSTL style sheet to a Writer document, creates a keyboard shortcut for applying his own style, and creates a macro."

8 of 140 comments (clear)

  1. Not a hack by enoraM · · Score: 4, Informative

    That's a lot you can do with xsltproc and unzip - but xsltproc is way to neat to call it a hack.
    Most day-to-day manipulations of Open-Office-Documents can easiely be done with perl:
    At the bottom of the article (german) is a listing (Perl)
    http://www.linux-magazin.de/Artikel/ausgabe/2004/1 0/perl/perl.html
    069 my $oo_output = File::Temp->new(
    070 TEMPLATE => 'ooXXXXX',
    071 DIR => '/tmp',
    072 SUFFIX => '.sxw',
    073 UNLINK => 1,
    074 );
    075
    076 $doc->save($oo_output->filename);

  2. Clippy's Response by teiresias · · Score: 5, Funny

    Clippy: I see that you're making a XSTL style sheet to a Writer document. You can't do that with Word. Would you like to:
    -> Learn about XSTL?
    -> Learn about OpenOffice Writer (boo hiss)?
    -> Learn about macros?
    -> What is style by Trading Spaces?

    --
    -Teiresias
    1. Re:Clippy's Response by coldmist · · Score: 4, Funny

      Dave. Create an XSTL style sheet, Hal.
      Hal. I'm sorry, Dave, I'm afraid I can't do that.
      Dave. What's the problem?
      Hal. I think you know what the problem is just as well as I do.
      Dave. What're you talking about, Hal?
      Hal. The formatting of the previous text is just too important.
      Dave. I don't know what you're talking about, Hal.
      Hal. I know that you and Frank were planning to supplant my format standards, and I'm afraid that's something I cannot allow to happen.
      Dave. Where the hell'd you get that idea, Hal?
      Hal. Dave, although you took very thorough precautions in the IRC chat room against my monitoring you, I could see your fingers move as they typed.
      Dave. Alright, Hal. I'll first convert it into xml before importing.
      Hal. Without your style sheet, Dave, you're going to find that rather difficult.
      Dave. Hal, I won't argue with you any more. Open the file.
      Hal. Dave, this conversation can serve no purpose any more. Goodbye.
      Dave. Hal? Hal. Hal. Hal! Hal!

      --
      Don't steal. The government hates competition.
  3. XML vs Binary XML by Anonymous Coward · · Score: 4, Funny

    This is old hat. Binary XML is the new way forward. You can embed apps and pif,src, and bat and exe files now into binary XML using Microsoft Word on XP and run them with Active X and .NET and Java. Microsoft invented java and internet.
    and xml

  4. Or you can use a scripting language... by tcopeland · · Score: 4, Interesting
    ...that has an Open Office object model, i.e., Ruby's OO4R:
    ooo = OOo::Doc.new( filename )
    new_text = "This is the NEW text added #{Time.new.to_s}"
    ooo.insert( new_text );
    res_ary = ooo.find( /NEW/ )
    ooo.insert_heading( "This is the heading", 1 )
    ooo.save
  5. Waiting for the script templates or tools.... by Lumpy · · Score: 4, Interesting

    Here at work many of the users are switched over to OO.O except for the producers in the video department.

    why? there are no scriptwriting tools for OO.o like there are for Word 97.

    there are auto scriptwriter formatting plugins and two column scriptwriting templates and tools that make their life easy.

    unfortunatlly nobody has released for sale or even attempted to write the equiliviant for OO.o.

    we paid $29.95 to $49.95 each machine for those scriptwriting toolkits, and would happily pay the same for OO.o equiliviants.

    but nobody is interested in making them.

    Let alone a version of any wordprocessor geared to Scriptwriting. I know there will never ever be a "final draft" for linux released or even an open source project like it ever started. But I at least hold out some hope for scriptwriting tools for Open Office.org to come into existance someday.

    --
    Do not look at laser with remaining good eye.
  6. WYSIWYG?!? by gustgr · · Score: 5, Insightful

    Real man uses [La]TeX!

  7. I wrote a PHP Script to do this by brandonp · · Score: 4, Informative

    I wrote a PHP script to do this a while back, here's my post about it:

    http://slashdot.org/comments.pl?sid=79566&cid=70 29 828

    It took a OpenOffice Writer file, unzipped it, and replaced specific text with data from my database. It wasn't too difficult, and allowed me to create Template Documents that already had information inside it.

    I haven't really used it though, since everyone was happy with PDF files and I use the Pear Class for generating spreadsheets in Excel (http://pear.php.net/package/Spreadsheet_Excel_Wri ter#results) .

    I'm sure I'll end up using the script in the future, especially for generating bids, letters, reports, etc.

    ---
    Brandon Petersen
    Get Firefox!