public class PTreeWriter
extends java.lang.Object
Constructor and Description |
---|
PTreeWriter(ProfessionalConfiguration config) |
Modifier and Type | Method and Description |
---|---|
static void |
copyToPTree(javax.xml.transform.Source in,
ParseOptions options,
java.io.OutputStream out)
Static utility method for writing a Ptree
|
static void |
main(java.lang.String[] args)
Command line interface for writing a Ptree
|
void |
setPTreeVersion(int version)
Set the PTree version to be written.
|
void |
writeTree(TinyTree tree,
java.io.DataOutputStream out)
Serialize a TinyTree in PTree format to a supplied output stream
|
public PTreeWriter(ProfessionalConfiguration config)
public void setPTreeVersion(int version)
version
- the version to be written. Must be 0.public void writeTree(TinyTree tree, java.io.DataOutputStream out) throws java.io.IOException
tree
- the tree to be serializedout
- the output stream. Responsibility for closing this stream rests with the callerjava.io.IOException
- if any error occurs writing to the output stream.public static void copyToPTree(javax.xml.transform.Source in, ParseOptions options, java.io.OutputStream out) throws XPathException, java.io.IOException
in
- the Source representing the document to be written as a PTreeoptions
- the options to be used when processing the input sourceout
- the OutputStream to which the PTree is written. The responsibility for closing
this stream rests with the caller.XPathException
- if any failure occurs processing the inputjava.io.IOException
- if any failure occurs writing the outputpublic static void main(java.lang.String[] args) throws java.lang.Exception
args
- [-strip] source.xml out.treejava.lang.Exception
- if the operation failsCopyright (c) 2004-2018 Saxonica Limited. All rights reserved.