Commit 76af0c45 authored by Fabien Triolet's avatar Fabien Triolet
Browse files

Serializer can write to the standard output

parent 74cb98c4
/** /**
* $Id: writefile.java,v 1.9 2002-11-04 08:58:06 jerome Exp $ * $Id: writefile.java,v 1.10 2002-11-06 07:58:26 triolet Exp $
* *
* Transmorpher * Transmorpher
* *
...@@ -106,7 +106,7 @@ public final class writefile extends TSerializer { ...@@ -106,7 +106,7 @@ public final class writefile extends TSerializer {
*/ */
public void setOutputStream() throws TMRuntimeException, TMException, SAXException { public void setOutputStream() throws TMRuntimeException, TMException, SAXException {
super.setOutputStream(); super.setOutputStream();
if (fileName.lastIndexOf('$')==-1){ if ((fileName.lastIndexOf('$')==-1)&&(!printOut)){
try { try {
FileOutputStream FOS = null; FileOutputStream FOS = null;
FOS = new FileOutputStream(new File(fileName)); FOS = new FileOutputStream(new File(fileName));
...@@ -117,6 +117,10 @@ public final class writefile extends TSerializer { ...@@ -117,6 +117,10 @@ public final class writefile extends TSerializer {
} catch (Exception e) { } catch (Exception e) {
throw new TMRuntimeException( e, "Output stream error"); throw new TMRuntimeException( e, "Output stream error");
} }
}
else {
handler.setResult(new StreamResult(System.out));
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment