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.
|
String |
getXMLBase() |
void |
setEncoding(String encoding)
Sets the encoding for the document that the RDF writer produces.
|
void |
setWrapAttributes(boolean b)
Causes the current element's attributes to be wrapped in the output.
|
void |
startDocument(IRI rootElement)
Starts writing the document.
|
void |
writeAttribute(IRI attr,
String val)
Writes an attribute of the last element to be started (that has not been closed).
|
void |
writeAttribute(String attr,
String val)
Writes an attribute of the last element to be started (that has not been closed).
|
void |
writeComment(String commentText) |
void |
writeEndElement()
Writes the closing tag of the last element to be started.
|
void |
writeStartElement(IRI name)
Writes the start of an element.
|
void |
writeTextContent(String text)
Writes a text element.
|
void setEncoding(String encoding)
UTF-8
.encoding
- The encoding.XMLWriterNamespaceManager getNamespacePrefixes()
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(IRI rootElement)
rootElement
- The iri of the root element.void endDocument()
void writeStartElement(IRI name)
name
- The tag name of the element to be written. This must be a valid QName. @throws
IllegalElementNameException if the specified name is not a valid QNamevoid writeEndElement()
void writeAttribute(String attr, String val)
attr
- The name of the attributeval
- The value of the attributevoid writeAttribute(IRI attr, String val)
attr
- The name of the attributeval
- The value of the attributevoid writeTextContent(String text)
text
- The text to be writtenvoid writeComment(String commentText)
commentText
- comment textCopyright © 2020 The University of Manchester. All rights reserved.