For better performance, here is another idea.

 0. Register a simple XSLT template as an input filter
    to your OpenOffice.org.

 1. Do the XSLT transformation with Java or any other command
    such as a xsltproc command alone and save the result as a
    temporary file.

 2. Let the OpenOffice.org to read the temporary file through
    the simple XSLT template which will just do <xsl:copy>.

In the step 6 below would make a bad performance if the external
Java program is running separately from OpenOffice.org and connecting
to the OpenOffice.org through TCP/IP or named pipe.

It would be possible to let the Java program run as a process
of OpenOffice.org which could dynamically load a Java VM into
a process of OpenOffice.org so that the Java program would be
running more efficiently. To do so, however, you would need to
develop your Java program as a UNO component and deploy it to
your OpenOffice.org.

As you know, Java classes could be packed into .war file and
be deployed to an application server, you can deploy your
Java classes to your OpenOffice.org as a UNO component.
However, I guess, it might be far beyond your expectation.

Any much cooler idea?
Tora

tora - Takamichi Akiyama wrote:
If you will need to use several XSLT templates on demand, I am not
sure, though, but the section "Importer Filtering" and "Parsing
the Result" in [1] could be one of the possible solutions.
[1] http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/The_Importer

 1. Create a stream (1) which will read the target file.
 2. Create a stream (2) which will read the XSLT file.
 3. Create a XSLT transformer (3) with (2).
 4. Create a pipe (4),(5).
 5. Transform (1) with (3) and write results to (4).
 6. Let the OpenOffice.org to read (5) coming from (4).

So, it could be no need to use a XSLT function embedded in OpenOffice.org.
Just use available XSLT such as javax.xml.transform, instead and
give the result to the OpenOffice.org.

Examples (also available in the SDK; actually its source code)
[2] http://svn.services.openoffice.org/ooo/tags/OpenOffice_3_1_0/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/

Any cool ideas?


Jakob Mandalka wrote:
Ok thanks, i figured it out. But now the next Problem.

How I can register a filter using this API?

At the moment I added my filter via the menu in Open Office but I want
to change that.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org

Reply via email to