public interface IXmlWriter
Modifier and Type | Method and Description |
---|---|
void |
flushDocument()
Close the document.
|
IXmlNamespaceManager |
getNamespaceManager()
Gets the namespace manager associated with this writer.
|
default IXmlWriter |
writeAttribute(GraphMLXmlAttribute attribute)
Write an XML attribute from the given
attribute struct. |
default IXmlWriter |
writeAttribute(String localName,
String value)
Write an XML attribute with the given parameters.
|
IXmlWriter |
writeAttribute(String prefix,
String localName,
String ns,
String value)
Write a XML attribute node.
|
IXmlWriter |
writeCData(String content)
Write a CDATA section.
|
IXmlWriter |
writeComment(String comment)
Write a XML comment node.
|
IXmlWriter |
writeDocumentFragment(Document fragment)
Write a document fragment.
|
void |
writeEndDocument()
Close the output.
|
IXmlWriter |
writeEndElement()
Close a XML element previously opened with
writeStartElement(String, String) or
writeStartElement(String, String, String) . |
IXmlWriter |
writeProcessingInstruction(String target,
String data)
Write a xml processing instruction.
|
IXmlWriter |
writeStartDocument()
Begin the output process.
|
IXmlWriter |
writeStartElement(String localName,
String ns)
Begin a new XML element with given parameters.
|
IXmlWriter |
writeStartElement(String prefix,
String localName,
String ns)
Begin a new XML element with given parameters.
|
IXmlWriter |
writeString(String s)
Write a text node.
|
void flushDocument()
This is typically used to actually flush the document to an output stream
IXmlNamespaceManager getNamespaceManager()
default IXmlWriter writeAttribute(GraphMLXmlAttribute attribute)
attribute
struct.attribute
- Encapsulates the current attribute values.writer
for writer chaining.default IXmlWriter writeAttribute(String localName, String value)
The attribute is not bound to a XML namespace.
localName
- The name of the attribute.value
- The value of the attribute.writer
for writer chaining.IXmlWriter writeAttribute(String prefix, String localName, String ns, String value)
The attribute is attached to the closest open XML element that has been started with writeStartElement(String, String)
or writeStartElement(String, String, String)
prefix
- The namespace prefix of the attributelocalName
- The local name of the attributens
- The namespace URI of this attributevalue
- The value of this attributeIXmlWriter writeCData(String content)
content
- The content of the CDATA sectionIXmlWriter writeComment(String comment)
comment
- The content of the commentIXmlWriter writeDocumentFragment(Document fragment)
void writeEndDocument()
Attempts to write after this method has been called will have undefined results.
IXmlWriter writeEndElement()
writeStartElement(String, String)
or
writeStartElement(String, String, String)
.IXmlWriter writeProcessingInstruction(String target, String data)
target
- The target of the PIdata
- The data of the PIIXmlWriter writeStartDocument()
IXmlWriter writeStartElement(String localName, String ns)
All subsequent output is attached to this element until writeEndElement()
has been called or a new element has
been started.
This acts like writeStartElement(String, String, String)
, but uses the default prefix for the namespace
localName
- The local name of this elementns
- The namespace of this elementIXmlWriter writeStartElement(String prefix, String localName, String ns)
All subsequent output is attached to this element until writeEndElement()
has been called or a new element has
been started.
prefix
- The namespace prefix to use for this elementlocalName
- The local name of this elementns
- The namespace of this elementIXmlWriter writeString(String s)
The string value of s
will be correctly escaped
s
- The string that gets written as XML text