OpenOffice XSLT XML data merge
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2009 08:54 PM
I have created a prototype project for a standalone document service that works by applying external data to an OpenOffice document using XSLT.
The service works by unpacking the odf, extracting the relevant file (e.g. content.xml), and applying data from an external xml file. The new merged file is then repackaged into the odf and a conversion process allows you to convert the file to various formats (pdf, etc).
Example XSLT:
The benefit of using XSLT on the ODF file in this manner allows business users to provide document templates. Developers can then create the XSLT to fill the document template without having to modify the original ODF file.
Is functionality similar to above available in Alfresco?
Many thanks in advance,
Chris
The service works by unpacking the odf, extracting the relevant file (e.g. content.xml), and applying data from an external xml file. The new merged file is then repackaged into the odf and a conversion process allows you to convert the file to various formats (pdf, etc).
Example XSLT:
<?xml version="1.0"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" version="1.0"> <xsl:output method="xml" indent="yes"/> <xsl:template match="node()|@*"> <xsl:copy><xsl:apply-templates select="node()|@*"/></xsl:copy> </xsl:template> <xsl:template match="text:p[text() = 'Replace me!']"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:value-of select="document('data.xml')/map/entry[@key='key1']/@value"/> </xsl:copy> </xsl:template></xsl:stylesheet>
The benefit of using XSLT on the ODF file in this manner allows business users to provide document templates. Developers can then create the XSLT to fill the document template without having to modify the original ODF file.
Is functionality similar to above available in Alfresco?
Many thanks in advance,
Chris
Labels:
- Labels:
-
Archive
4 REPLIES 4

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2009 04:11 AM
Hi,
I have the same kind of requirement.
I have a "template file" in OpenOffice text Format, whici holds some variables (like "${reference}").
I have a Java class that builds a HashMap of (key, value).
I'd like to generate a PDF document from de odf template file, and the Map of data (as I would be able to do easily with freemarker).
What is the best practice to do that ?
I have the same kind of requirement.
I have a "template file" in OpenOffice text Format, whici holds some variables (like "${reference}").
I have a Java class that builds a HashMap of (key, value).
I'd like to generate a PDF document from de odf template file, and the Map of data (as I would be able to do easily with freemarker).
What is the best practice to do that ?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2009 05:46 AM
Found a solution using JodReports (you ll find it on sourceforge)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2009 07:45 AM
FYI: from JodReports website
Warning! This project is now unmaintained. The latest version 2.0.0 was released back in September 2006. You may still find it useful, since it is open source you are free to get the code and modify it, but be aware that the original author is no longer developing it.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2009 04:58 AM
I know, I saw it, but still, I tried and it worked.
FYI, a part of the project JODREPORTS is already included in Alfresco : jodconverter.
Thank you anyway
FYI, a part of the project JODREPORTS is already included in Alfresco : jodconverter.
Thank you anyway
