OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

How to open own format file with XSLT filter

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
mynfred
General User
General User


Joined: 16 Feb 2008
Posts: 22

PostPosted: Wed Mar 19, 2008 6:35 pm    Post subject: How to open own format file with XSLT filter Reply with quote

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
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3533
Location: Hamburg, Germany

PostPosted: Thu Mar 20, 2008 12:26 am    Post subject: Re: How to open own format file with XSLT filter Reply with quote

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
View user's profile Send private message
mynfred
General User
General User


Joined: 16 Feb 2008
Posts: 22

PostPosted: Fri Mar 21, 2008 3:05 am    Post subject: Reply with quote

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
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3533
Location: Hamburg, Germany

PostPosted: Fri Mar 21, 2008 3:19 am    Post subject: Reply with quote

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
View user's profile Send private message
mynfred
General User
General User


Joined: 16 Feb 2008
Posts: 22

PostPosted: Mon Apr 07, 2008 6:53 pm    Post subject: Reply with quote

Maybe following helps

http://framework.openoffice.org/documentation/filters/example.html#register_filter

but I try it many times, unfortunately, I failed.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group