org.exist.util.serializer
Class XMLWriter
java.lang.Object
org.exist.util.serializer.XMLWriter
- Direct Known Subclasses:
- IndentingXMLWriter, JSONWriter, TEXTWriter
public class XMLWriter
- extends Object
Write XML to a writer. This class defines methods similar to SAX. It deals
with opening and closing tags, writing attributes and so on.
- Author:
- wolf
Method Summary |
void |
attribute(QName qname,
String value)
|
void |
attribute(String qname,
String value)
|
void |
cdataSection(char[] ch,
int start,
int len)
|
void |
characters(char[] ch,
int start,
int len)
|
void |
characters(CharSequence chars)
|
void |
comment(CharSequence data)
|
void |
documentType(String name,
String publicId,
String systemId)
|
void |
endDocument()
|
void |
endElement(QName qname)
|
void |
endElement(String qname)
|
String |
getDefaultNamespace()
|
void |
namespace(String prefix,
String nsURI)
|
void |
processingInstruction(String target,
String data)
|
void |
setDefaultNamespace(String namespace)
|
void |
setOutputProperties(Properties properties)
Set the output properties. |
void |
setWriter(Writer writer)
Set a new writer. |
void |
startDocument()
|
void |
startElement(QName qname)
|
void |
startElement(String qname)
|
XMLWriter
public XMLWriter()
XMLWriter
public XMLWriter(Writer writer)
setOutputProperties
public void setOutputProperties(Properties properties)
- Set the output properties.
- Parameters:
properties
- outputProperties
setWriter
public void setWriter(Writer writer)
- Set a new writer. Calling this method will reset the state of the object.
- Parameters:
writer
-
getDefaultNamespace
public String getDefaultNamespace()
setDefaultNamespace
public void setDefaultNamespace(String namespace)
startDocument
public void startDocument()
throws TransformerException
- Throws:
TransformerException
endDocument
public void endDocument()
throws TransformerException
- Throws:
TransformerException
startElement
public void startElement(String qname)
throws TransformerException
- Throws:
TransformerException
startElement
public void startElement(QName qname)
throws TransformerException
- Throws:
TransformerException
endElement
public void endElement(String qname)
throws TransformerException
- Throws:
TransformerException
endElement
public void endElement(QName qname)
throws TransformerException
- Throws:
TransformerException
namespace
public void namespace(String prefix,
String nsURI)
throws TransformerException
- Throws:
TransformerException
attribute
public void attribute(String qname,
String value)
throws TransformerException
- Throws:
TransformerException
attribute
public void attribute(QName qname,
String value)
throws TransformerException
- Throws:
TransformerException
characters
public void characters(CharSequence chars)
throws TransformerException
- Throws:
TransformerException
characters
public void characters(char[] ch,
int start,
int len)
throws TransformerException
- Throws:
TransformerException
processingInstruction
public void processingInstruction(String target,
String data)
throws TransformerException
- Throws:
TransformerException
comment
public void comment(CharSequence data)
throws TransformerException
- Throws:
TransformerException
cdataSection
public void cdataSection(char[] ch,
int start,
int len)
throws TransformerException
- Throws:
TransformerException
documentType
public void documentType(String name,
String publicId,
String systemId)
throws TransformerException
- Throws:
TransformerException
Copyright (C) Wolfgang Meier. All rights reserved.