I have a function:
.....
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.*;
protected void doSave(){
SVGDocument doc = svgComponent.getSVGDocument();
if(doc == null){
return;
}
JFileChooser fc = new JFileChooser(".");
int choice = fc.showSaveDialog(svgComponent);
if (choice == JFileChooser.APPROVE_OPTION){
try{
java.io.File f = fc.getSelectedFile();
DOMSource source = new DOMSource(doc.getRootElement());
StreamResult result = new StreamResult(new
FileOutputStream(f));
Transformer transformer =
TransformerFactory.newInstance().newTransformer();
transformer.transform(source,result);
}catch(Exception ex){
ex.printStackTrace();
}
}
}
which throws Exception with message:
XSL-1101: (Fatal Error) DOMSource node as this type not supported.
javax.xml.transform.TransformerException: XSL-1101: (Fatal Error) DOMSource node as
this type not supported.
at oracle.xml.jaxp.JXTransformer.reportException(JXTransformer.java:725)
at oracle.xml.jaxp.JXTransformer.transform(JXTransformer.java:196)
at borlas.netplan.NetPlan.doSave(NetPlan.java:327)
at borlas.netplan.NetPlan$3.actionPerformed(NetPlan.java:174)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450)
at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1504)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:378)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:250)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:216)
at java.awt.Component.processMouseEvent(Component.java:3715)
at java.awt.Component.processEvent(Component.java:3544)
at java.awt.Container.processEvent(Container.java:1164)
at java.awt.Component.dispatchEventImpl(Component.java:2593)
at java.awt.Container.dispatchEventImpl(Container.java:1213)
at java.awt.Component.dispatchEvent(Component.java:2497)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2451)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2216)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2125)
at java.awt.Container.dispatchEventImpl(Container.java:1200)
at java.awt.Window.dispatchEventImpl(Window.java:914)
at java.awt.Component.dispatchEvent(Component.java:2497)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]