com.icl.saxon.output
public class GeneralOutputter extends Outputter
Constructor and Description |
---|
GeneralOutputter(NamePool pool) |
Modifier and Type | Method and Description |
---|---|
int |
checkAttributePrefix(int nameCode)
Check that the prefix for an attribute is acceptable, returning a substitute
prefix if not.
|
void |
close()
Close the output
|
void |
copyNamespaceNode(int nscode)
Copy a namespace node to the current element node
(Rules defined in XSLT 1.0 errata)
|
protected void |
flushStartTag()
Flush out a pending start tag
|
Properties |
getOutputProperties() |
Emitter |
makeEmitter(Properties props,
Result result)
Make an emitter appropriate for a given set of output properties and
output destination.
|
static FileOutputStream |
makeFileOutputStream(String baseURI,
String fileName,
boolean mkdirs)
Create a new FileOutputStream, given a filename and a baseURI
|
void |
reset()
Synchronize the state of the Outputter with that of the underlying Emitter
|
void |
setOutputDestination(Properties props,
Result result)
Initialise the outputter for a new output destination, supplying
the output format details.
|
boolean |
thereIsAnOpenStartTag()
Test whether there is an open start tag.
|
static String |
urlToFileName(String base)
The following atrocious code is borrowed from Xalan, where it is commented simply:
// yuck.
|
void |
write(String s)
Produce literal output.
|
void |
writeAttribute(int nameCode,
String value)
Output an attribute value.
|
void |
writeAttribute(int nameCode,
String value,
boolean noEscape)
Output an attribute value.
|
void |
writeComment(String comment)
Write a comment
|
void |
writeContent(char[] chars,
int start,
int length)
Produce text content output.
|
void |
writeContent(String s)
Produce text content output.
|
void |
writeContent(StringBuffer chars,
int start,
int len)
Produce text content output.
|
void |
writeEndTag(int nameCode)
Output an element end tag.
|
void |
writeNamespaceDeclaration(int nscode)
Output a namespace declaration.
|
void |
writePI(String target,
String data)
Write a processing instruction
|
void |
writeStartTag(int nameCode)
Output an element start tag.
|
getEmitter, open, setEscaping
public GeneralOutputter(NamePool pool)
public void setOutputDestination(Properties props, Result result) throws TransformerException
outputProperties
- Details of the new output formatresult
- Details of the new output destinationTransformerException
public static String urlToFileName(String base)
public static FileOutputStream makeFileOutputStream(String baseURI, String fileName, boolean mkdirs) throws TransformerException
TransformerException
public Emitter makeEmitter(Properties props, Result result) throws TransformerException
TransformerException
public void reset() throws TransformerException
Outputter
reset
in class Outputter
TransformerException
public Properties getOutputProperties()
getOutputProperties
in class Outputter
public void write(String s) throws TransformerException
Outputter
write
in class Outputter
TransformerException
public void writeContent(String s) throws TransformerException
writeContent
in class Outputter
s
- The String to be outputTransformerException
- for any failurepublic void writeContent(char[] chars, int start, int length) throws TransformerException
writeContent
in class Outputter
chars
- Character array to be outputstart
- start position of characters to be outputlength
- number of characters to be outputTransformerException
- for any failurepublic void writeContent(StringBuffer chars, int start, int len) throws TransformerException
chars
- StringBuffer containing to be outputstart
- start position of characters to be outputlen
- number of characters to be outputTransformerException
- for any failurepublic void writeStartTag(int nameCode) throws TransformerException
writeStartTag
in class Outputter
nameCode
- The element name codeTransformerException
public int checkAttributePrefix(int nameCode) throws TransformerException
checkAttributePrefix
in class Outputter
TransformerException
public void writeNamespaceDeclaration(int nscode) throws TransformerException
writeNamespaceDeclaration
in class Outputter
nscode
- The namespace codeTransformerException
- if there is no start tag to write to (created using writeStartTag),
or if character content has been written since the start tag was written.public void copyNamespaceNode(int nscode) throws TransformerException
copyNamespaceNode
in class Outputter
TransformerException
public boolean thereIsAnOpenStartTag()
thereIsAnOpenStartTag
in class Outputter
public void writeAttribute(int nameCode, String value) throws TransformerException
writeAttribute
in class Outputter
nameCode
- The name code of the attributevalue
- The value of the attributeTransformerException
- if there is no start tag to write to (created using writeStartTag),
or if character content has been written since the start tag was written.public void writeAttribute(int nameCode, String value, boolean noEscape) throws TransformerException
writeAttribute
in class Outputter
name
- The name of the attributevalue
- The value of the attributenoEscape
- True if it's known there are no special characters in the value. If
unsure, set this to false.TransformerException
- if there is no start tag to write to (created using writeStartTag),
or if character content has been written since the start tag was written.public void writeEndTag(int nameCode) throws TransformerException
writeEndTag
in class Outputter
nameCode
- The element name codeTransformerException
public void writeComment(String comment) throws TransformerException
writeComment
in class Outputter
TransformerException
public void writePI(String target, String data) throws TransformerException
writePI
in class Outputter
TransformerException
public void close() throws TransformerException
close
in class Outputter
TransformerException
protected void flushStartTag() throws TransformerException
TransformerException