public interface IXmlWriter extends Flushable, Closeable
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the writer and the underlying output stream.
|
void |
flush()
Flush the writer and force any buffered data to be written.
|
String |
getEncoding()
Get the encoding of the writer.
|
String |
getXmlLang()
Get the language of the current element.
|
XmlSpace |
getXmlSpace()
Get the space of the current element.
|
void |
writeAttributeString(String localName,
String value)
Write an attribute with the specified local name and value.
|
void |
writeAttributeString(String localName,
String ns,
String value)
Write an attribute with the specified local name, namespace URI, and value.
|
void |
writeAttributeString(String prefix,
String localName,
String ns,
String value)
Write an attribute with the specified prefix, local name, namespace URI, and value.
|
void |
writeDocType(String name,
String pubid,
String sysid,
String subset)
Write the doc type for the XML.
|
void |
writeElementString(String localName,
String ns,
String value)
Write a leaf element with the specified local name, namespace URI, and value.
|
void |
writeElementString(String prefix,
String localName,
String ns,
String value)
Write a leaf element with the specified prefix, local name, namespace URI, and value.
|
void |
writeEndDocument()
Write the end of the document.
|
void |
writeEndElement()
Write an element end tag.
|
void |
writeNamespacePrefixDefinition(String prefix,
String ns)
Define a namespace prefix in the current context.
|
void |
writeRaw(String data)
Write raw XML to the stream.
|
void |
writeStartDocument()
Write the start of the document.
|
void |
writeStartElement(String localName,
String ns)
Write an element start tag with the specified local name and namespace URI.
|
void |
writeStartElement(String prefix,
String localName,
String ns)
Write an element start tag with the specifiedprefix, local name, and namespace URI.
|
void |
writeString(String text)
Write element content.
|
void close()
throws XmlWriterException
close in interface AutoCloseableclose in interface CloseableXmlWriterException - if there is a problem closing the writer or the underlying output stream.void flush()
throws XmlWriterException
flush in interface FlushableXmlWriterException - if there is a problem flushing the writer.void writeStartDocument()
throws XmlWriterException
XmlWriterException - if there is a problem writing the start of the document.void writeEndDocument()
throws XmlWriterException
XmlWriterException - if there is a problem writing the end of the document.void writeDocType(String name, String pubid, String sysid, String subset) throws XmlWriterException
name - The name of the doc type. Must be the same as the root element. May not be null.pubid - If non-null it also writes "pubid" "sysid" where pubid and sysid are replaced with the value of the given arguments.sysid - f pubid is null and sysid is non-null it writes SYSTEM "sysid" where sysid is replaced with the value of this argument.subset - If non-null it writes [subset] where subset is replaced with the value of this argument.XmlWriterException - if there is a problem writing the doc type.void writeStartElement(String localName, String ns) throws XmlWriterException
localName - write an element start tag with this local name.ns - write an element start tag with this namespace URI.XmlWriterException - if there is a problem writing the start tag.void writeStartElement(String prefix, String localName, String ns) throws XmlWriterException
prefix - write an element start tag with this namespace prefix.localName - write an element start tag with this local name.ns - write an element start tag with this namespace URI.XmlWriterException - if there is a problem writing the start tag.void writeEndElement()
throws XmlWriterException
XmlWriterException - if there is a problem writing the end tag.void writeElementString(String localName, String ns, String value) throws XmlWriterException
localName - write a leaf element with this local name.ns - write a leaf element with this namespace URI.value - write a leaf element with this value.XmlWriterException - if there is a problem writing the element.void writeElementString(String prefix, String localName, String ns, String value) throws XmlWriterException
prefix - write a leaf element with this namespace prefix.localName - write a leaf element with this local name.ns - write a leaf element with this namespace URI.value - write a leaf element with this value.XmlWriterException - if there is a problem writing the element.void writeAttributeString(String localName, String value) throws XmlWriterException
localName - write an attribute with this local name.value - write an attribute with this value.XmlWriterException - if there is a problem writing the attribute.void writeAttributeString(String localName, String ns, String value) throws XmlWriterException
localName - write an attribute with this local name.ns - write an attribute with this namespace URI.value - write an attribute with this value.XmlWriterException - if there is a problem writing the attribute.void writeAttributeString(String prefix, String localName, String ns, String value) throws XmlWriterException
prefix - write an attribute with this namespace prefix.localName - write an attribute with this local name.ns - write an attribute with this namespace URI.value - write an attribute with this value.XmlWriterException - if there is a problem writing the attribute.void writeNamespacePrefixDefinition(String prefix, String ns) throws XmlWriterException
prefix - The namespace prefix to be defined.ns - The namespace value for the new prefix definition.XmlWriterException - if there is a problem defining the prefix.void writeString(String text) throws XmlWriterException
text - The content to be written inside the element.XmlWriterException - if there is an error writing the content or the writer is in an invalid state for writing content.void writeRaw(String data) throws XmlWriterException
data - Write the XML contained in this string to the stream. Must be valid XML.XmlWriterExceptionXmlSpace getXmlSpace()
String getXmlLang()
String getEncoding()
© 2007, 2022 Precisely. All rights reserved.