[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Could not compile stylesheet message upon running tra

Subject: Could not compile stylesheet message upon running transformation in java
From: UlyLee <ulyleeka@xxxxxxxxx>
Date: Wed, 28 Dec 2005 02:56:10 -0800 (PST)
could not compile stylesheet
I'm new in java and was trying out running
transformation using the javax.xml.transform. I
designed my code using the Sun Java Studio Enterprise
and i have no problems running my code and
transformation in the IDE but when i create a jar file
and then run my application i get a could not compile
stlysheet message.

I have this stacktrace generated from the error:
javax.xml.transform.TransformerConfigurationException:
Could not compile stylesheet
	at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(Unknown
Source)
	at
ya2.CombineUtility.processTransform(CombineUtility.java:357)
	at
ya2.CombineUtility.jButton3ActionPerformed(CombineUtility.java:316)
	at
ya2.CombineUtility.access$400(CombineUtility.java:19)
	at
ya2.CombineUtility$5.actionPerformed(CombineUtility.java:179)
	at
javax.swing.AbstractButton.fireActionPerformed(Unknown
Source)
	at
javax.swing.AbstractButton$Handler.actionPerformed(Unknown
Source)
	at
javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
Source)
	at javax.swing.DefaultButtonModel.setPressed(Unknown
Source)
	at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown
Source)
	at java.awt.Component.processMouseEvent(Unknown
Source)
	at javax.swing.JComponent.processMouseEvent(Unknown
Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown
Source)
	at java.awt.Container.dispatchEventImpl(Unknown
Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at
java.awt.LightweightDispatcher.retargetMouseEvent(Unknown
Source)
	at
java.awt.LightweightDispatcher.processMouseEvent(Unknown
Source)
	at
java.awt.LightweightDispatcher.dispatchEvent(Unknown
Source)
	at java.awt.Container.dispatchEventImpl(Unknown
Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
Source)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown
Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown
Source)
	at java.awt.EventDispatchThread.run(Unknown Source)

I dont quite figure out why its telling me that the
xsl file is an unknown source. I have the xsl files
needed for my application at the same folder as that
of the jar file.

here is my java code:

processTransform(files[i], new
File("YA2Combine_1.0.xsl"));

public void processTransform(File sourceID, File
xslID)
            throws TransformerException,
TransformerConfigurationException {
        String str="", pFile="", paramDir="",
outFile="";
             
        TransformerFactory tfactory =
TransformerFactory.newInstance();
        Templates templates =
tfactory.newTemplates(new StreamSource(xslID));
        Transformer transformer =
templates.newTransformer();
        paramDir = sourceID.getParent().substring(0,
sourceID.getParent().length()-13);
        paramDir = paramDir.replace("\\","/") +
"Processed file/";
        str = sourceID.getName().substring(0,
sourceID.getName().length()-5);        
        pFile = "file:///" + paramDir + str + "P.xml";
        transformer.setParameter("PFile",
pFile.replace(" ", "%20"));
        outFile =
outputFolder.toString().replace("\\", "/") + "/" + str
+ "M.xml";
        File outputFile = new File(outFile);
        try{
            StreamResult out = new StreamResult(new
FileOutputStream(outputFile));
            transformer.transform(new
StreamSource(sourceID), out);
            out.getOutputStream().close();
        }catch(TransformerException e){
            System.out.println(e.toString());
            JOptionPane.showMessageDialog(this,
e.toString(), "Error", JOptionPane.ERROR_MESSAGE);
        }catch(IOException ex) {
            System.out.println(ex.toString());
            JOptionPane.showMessageDialog(this,
ex.toString(), "Error", JOptionPane.ERROR_MESSAGE);
        }
        jLabel3.setText("Generating report");
        processReport(outputFile, new
File("YA2CombineReport_1.0.xsl"), pFile);
    }

Hope someone can help me with this!
Thanks,
UlyLee



		
__________________________________________ 
Yahoo! DSL  Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com 

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.