| View previous topic :: View next topic |
| Author |
Message |
mynfred General User

Joined: 16 Feb 2008 Posts: 22
|
Posted: Wed Mar 19, 2008 6:35 pm Post subject: How to open own format file with XSLT filter |
|
|
I wrote one XSLT file and add it to Ooo by GUI of SWriter, it open my format file normally, now I want to implement this step by Call API, what can I do?
By the way
I try to createInstance
com.sun.star.document.FilterFactory
And call getElementNames, it return nothing, what's wrong with it?
Can anybody tell me some suggestion, I am looking forward to it.
Thanks in advane
Regards,
Mynfred |
|
| Back to top |
|
 |
hol.sten Super User


Joined: 14 Nov 2004 Posts: 3532 Location: Hamburg, Germany
|
Posted: Thu Mar 20, 2008 12:26 am Post subject: Re: How to open own format file with XSLT filter |
|
|
| mynfred wrote: | | I wrote one XSLT file and add it to Ooo by GUI of SWriter, it open my format file normally, now I want to implement this step by Call API, what can I do? |
I explained how to do this with OOo Basic here: [XML Filter] Create XSLT filters for import and export: http://user.services.openoffice.org/en/forum/viewtopic.php?f=45&t=3490.
The crucial OOo Basic part for you might be | Code: | ...
properties(0).Name = "FilterName"
properties(0).Value = "Calc_Payments"
... |
There you should replace Calc_Payments with the name YOU gave your XSLT filter.
If you don't want to use OOo Basic, no problem. Regardless which programming language you use, all you should keep in mind for opening or saving files with your filter, to use the filter name YOU gave your XSLT filter. That's all.
| mynfred wrote: | By the way
I try to createInstance
com.sun.star.document.FilterFactory
And call getElementNames, it return nothing, what's wrong with it? |
It's hard to guess from one posted line fragment. But anyway, YOU already know the name of your XSLT filter. So it's useless to look for it. And even if you've totally forgotten the name of your XSLT filter, how should a complete list of all available filter names tell you which one to use. |
|
| Back to top |
|
 |
mynfred General User

Joined: 16 Feb 2008 Posts: 22
|
Posted: Fri Mar 21, 2008 3:05 am Post subject: |
|
|
Thank you for your reply, It is helpful for my XSLT, and I try the XSTL filter by this ethod.
I also want to know how
Install the XSLT filters for import and export
by API, but not only by menu operation.
Regards,
Mynfred |
|
| Back to top |
|
 |
hol.sten Super User


Joined: 14 Nov 2004 Posts: 3532 Location: Hamburg, Germany
|
Posted: Fri Mar 21, 2008 3:19 am Post subject: |
|
|
| mynfred wrote: | I also want to know how
Install the XSLT filters for import and export
by API, but not only by menu operation. |
All I know is, that you can simplify the menu operations by creating an XSLT filter package via "Tools" > "XML Filter Settings..." > press button "Save as Package...". You can then install the XSLT filter on another OOo installation in the same dialog via pressing "Open Package...". Let me know if you find a way to do this trough calling the API. |
|
| Back to top |
|
 |
mynfred General User

Joined: 16 Feb 2008 Posts: 22
|
|
| Back to top |
|
 |
|