public interface XMLWriter
Modifier and Type | Method and Description |
---|---|
void |
endDocument()
Causes all open elements, including the document root
element, to be closed.
|
XMLWriterNamespaceManager |
getNamespacePrefixes()
Gets the Writer's namespace manager.
|
java.lang.String |
getXMLBase() |
void |
setEncoding(java.lang.String encoding)
Sets the encoding for the document that the rdfwriter produces.
|
void |
setWrapAttributes(boolean b)
Causes the current element's attributes to be wrapped in the
output.
|
void |
startDocument(java.lang.String rootElementName)
Starts writing the document.
|
void |
writeAttribute(java.lang.String attr,
java.lang.String val)
Writes an attribute of the last element to be started (that
has not been closed).
|
void |
writeComment(java.lang.String commentText) |
void |
writeEndElement()
Writes the closing tag of the last element to be started.
|
void |
writeStartElement(java.lang.String name)
Writes the start of an element.
|
void |
writeTextContent(java.lang.String text)
Writes a text element
|
void setEncoding(java.lang.String encoding)
encoding
- The encoding.XMLWriterNamespaceManager getNamespacePrefixes()
java.lang.String getXMLBase()
void setWrapAttributes(boolean b)
b
- If true
then the attributes will be wrapped if they are long. If false
then no attribute wrapping will occur.void startDocument(java.lang.String rootElementName) throws java.io.IOException
rootElementName
- The name of the root element.java.io.IOException
- if there was an IO problemvoid endDocument() throws java.io.IOException
java.io.IOException
- if there was an IO problemvoid writeStartElement(java.lang.String name) throws java.io.IOException, IllegalElementNameException
name
- The tag name of the element to be written. This must be a valid QName.java.io.IOException
- if there was an IO problemIllegalElementNameException
- if the specified name is not a valid QNamevoid writeEndElement() throws java.io.IOException
java.io.IOException
- if there was an IO problemvoid writeAttribute(java.lang.String attr, java.lang.String val) throws java.io.IOException
attr
- The name of the attributeval
- The value of the attributejava.io.IOException
- if there was an IO problemvoid writeTextContent(java.lang.String text) throws java.io.IOException
text
- The text to be writtenjava.io.IOException
- if there was an IO problemvoid writeComment(java.lang.String commentText) throws java.io.IOException
java.io.IOException