public class PTreeWriter extends Object
The format stored on disk is not dependent on the NamePool. Although it still uses name codes, it also contains a mapping of namecodes to the actual QNames.
The base URIs of nodes are not retained. Line numbers (if they were present in the original tree) are not retained.
| Constructor and Description |
|---|
PTreeWriter(ProfessionalConfiguration config) |
| Modifier and Type | Method and Description |
|---|---|
static void |
copyToPTree(Source in,
ParseOptions options,
OutputStream out)
Static utility method for writing a Ptree
|
static void |
main(String[] args)
Command line interface for writing a Ptree
|
void |
setPTreeVersion(int version)
Set the PTree version to be written.
|
void |
setTextMangler(TextMangler mangler)
Set a callback object that will be used to mangle the content of attribute
nodes and text nodes
|
void |
writeTree(TinyTree tree,
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 setTextMangler(TextMangler mangler)
mangler - the object to perform the content manglingpublic void writeTree(TinyTree tree, DataOutputStream out) throws IOException
tree - the tree to be serializedout - the output stream. Responsibility for closing this stream rests with the callerIOException - if any error occurs writing to the output stream.public static void copyToPTree(Source in, ParseOptions options, OutputStream out) throws XPathException, 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 inputIOException - if any failure occurs writing the outputCopyright (c) 2004-2013 Saxonica Limited. All rights reserved.