Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » SAXON in Eclipse
SAXON in Eclipse [message #327885] Wed, 07 May 2008 12:56 Go to next message
Conor Missing name is currently offline Conor Missing nameFriend
Messages: 159
Registered: July 2009
Senior Member
Hi all,

I'm trying to get a transform working from an RCP application. Works fine
for simple transform but I need to use SAXON 2.0 processor.

I'm guessing what I need to do is get some kind of SAXON plugin?

I'm not sure exactly what I need. I've seen a couple of Commerical pugins
but I need something free.

Can someone recommend what I should use.

Thanks,

Gaff
Forgot to mention... [message #327886 is a reply to message #327885] Wed, 07 May 2008 13:04 Go to previous messageGo to next message
Conor Missing name is currently offline Conor Missing nameFriend
Messages: 159
Registered: July 2009
Senior Member
... I dont't need an editor or anything like that. I just want to execute
the transform from java. (so I'm guessing I need some kind of plugin, if
possible to do transform without a new plugin all the better?) Along the
lines of:


try {
in = new FileInputStream("C:/test.xsl");
out = new FileInputStream(fileNamePublish);

FileInputStream xmlFile = out;
FileInputStream xsltFile = in;
Source xmlSource = new StreamSource(xmlFile);
Source xsltSource = new StreamSource(xsltFile);
TransformerFactory transFact =
TransformerFactory.newInstance();



try{

Transformer trans = transFact.newTransformer(xsltSource);
trans.transform(xmlSource, new StreamResult(System.out));
}catch(TransformerException me ) {}
Re: SAXON in Eclipse [message #327890 is a reply to message #327885] Wed, 07 May 2008 13:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Gaff wrote:
> Hi all,
>
> I'm trying to get a transform working from an RCP application. Works
> fine for simple transform but I need to use SAXON 2.0 processor.
>
> I'm guessing what I need to do is get some kind of SAXON plugin?
>
> I'm not sure exactly what I need. I've seen a couple of Commerical
> pugins but I need something free.
>
> Can someone recommend what I should use.

I would just include the SAXON JAR in the project (in a lib/ directory
and included on the project's classpath) and then you can call it's code
directly. When your app is built/exported, the JAR will be included - no
extra plugin necessary.

Hope this helps,
Eric
Re: SAXON in Eclipse [message #327908 is a reply to message #327890] Thu, 08 May 2008 09:24 Go to previous messageGo to next message
Conor Missing name is currently offline Conor Missing nameFriend
Messages: 159
Registered: July 2009
Senior Member
Hi Eric,

I right-clicked on my project and used Build path to add external
libraries. I can now import saxon API's.

However I'm not sure I've done this correctly as my code does not execute.

I'm using net.sf.saxon.TransformerFactoryImpl, when I try to execute code
with this it stops at this line and does not go any further.

The code I'm using is from:

http://blog.msbbc.co.uk/2007/06/simple-saxon-java-example.ht ml

So should work?

Gaff
Re: SAXON in Eclipse [message #327920 is a reply to message #327908] Thu, 08 May 2008 13:01 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Gaff wrote:
> Hi Eric,
>
> I right-clicked on my project and used Build path to add external
> libraries. I can now import saxon API's.
>
> However I'm not sure I've done this correctly as my code does not execute.
>
> I'm using net.sf.saxon.TransformerFactoryImpl, when I try to execute
> code with this it stops at this line and does not go any further.

I'm not sure what that means. Does it throw an exception?

Adding a library to the project's build path is only half the work - you
also need to include the same library(ies) on the runtime classpath; you
need to make sure it is specified in the Launch Configuration that you
use to run your application.

Eric
Previous Topic:how to write a runner
Next Topic:Eclipse 3.4 dropins folder not working?
Goto Forum:
  


Current Time: Wed Jul 03 10:26:43 GMT 2024

Powered by FUDForum. Page generated in 0.03959 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top