XSLT [message #758570] |
Wed, 23 November 2011 17:46 |
mehmetberat01 Messages: 1 Registered: November 2011 |
Junior Member |
|
|
Hi everyone,
I'm trying to write a program with java, which transforms the XML files with XSLT codes.
I've used Swing and added 2 buttons. Each button opens a filechooser. And with these filechoosers, i can import my xml and xsl file.
File xmlfile=null;
File xsltfile=null;
.....
.....
if (returnVal == JFileChooser.APPROVE_OPTION) {
xmlfile = fc.getSelectedFile();
}
.....
.....
if (returnVal == JFileChooser.APPROVE_OPTION) {
xsltfile = fc.getSelectedFile();
}
And then i'm saving the transformed XML file to this directory "/home/berat/transformed.xml"
try {
Transformer trans=transFact.newTransformer(xsltSource);
trans.transform(xmlSource, new StreamResult(new File("/home/beratTransformed.xml")));
}
catch (TransformerConfigurationException e1) {
e1.printStackTrace();
}
catch (TransformerException e2) {
e2.printStackTrace();
}
As you can see in my directory, i'm using linux. But i'm doing this project with a friend of mine and his operating system is windows.
So that's why i wanted to create a new file in my eclipse project. And call it Transformed.xml, to save the transformed file directly in the same package of my code.
But i couldn't make my program recognize the Transformed.xml. How can i solve it?
Thanks.
(You can see my whole code in attachment)
-
Attachment: transform
(Size: 4.32KB, Downloaded 113 times)
[Updated on: Wed, 23 November 2011 17:49] Report message to a moderator
|
|
|
Re: XSLT [message #759797 is a reply to message #758570] |
Wed, 30 November 2011 06:23 |
|
What do you mean by "recognize the Transformed.xml"? And what have you tried so far? What you've written is just hard-coded one way.
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
Powered by
FUDForum. Page generated in 0.08219 seconds