Newer Version Available
XmlStreamWriter Class
Namespace
Usage
You can use the XmlStreamWriter class to programmatically construct an XML document, then use HTTP classes to send the document to an external server.
The XmlStreamWriter class is similar to the XMLStreamWriter utility class from StAX.
XmlStreamWriter Methods
The following are methods for XmlStreamWriter. All are instance methods.
close()
Signature
public Void close()
Return Value
Type: Void
getXmlString()
Signature
public String getXmlString()
Return Value
Type: String
setDefaultNamespace(uri)
Signature
public Void setDefaultNamespace(String uri)
Parameters
- uri
- Type: String
Return Value
Type: Void
writeAttribute(prefix, namespaceUri, localName, value)
Signature
public Void writeAttribute(String prefix, String namespaceUri, String localName, String value)
Parameters
Return Value
Type: Void
writeCData(data)
Signature
public Void writeCData(String data)
Parameters
- data
- Type: String
Return Value
Type: Void
writeCharacters(text)
Signature
public Void writeCharacters(String text)
Parameters
- text
- Type: String
Return Value
Type: Void
writeComment(comment)
Signature
public Void writeComment(String comment)
Parameters
- comment
- Type: String
Return Value
Type: Void
writeDefaultNamespace(namespaceUri)
Signature
public Void writeDefaultNamespace(String namespaceUri)
Parameters
- namespaceUri
- Type: String
Return Value
Type: Void
writeEndDocument()
Signature
public Void writeEndDocument()
Return Value
Type: Void
writeEndElement()
Signature
public Void writeEndElement()
Return Value
Type: Void