public interface XMLWriter
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(String key,
String value)
Add a XML attribute to the current XML Element.
|
void |
endElement()
End the previously opened element.
|
void |
setDocType(String docType)
Sets the docType of the document.
|
void |
setEncoding(String encoding)
Sets the encoding of the document.
|
void |
startElement(String name)
Start an XML Element tag.
|
void |
writeMarkup(String text)
Add a preformatted markup to the current element tag
|
void |
writeText(String text)
Add a value text to the current element tag
This will perform XML escaping to guarantee valid content
|
void setEncoding(String encoding)
encoding
- the encodingIllegalStateException
- if the generation of the document has already startedvoid setDocType(String docType)
docType
- the docTypeIllegalStateException
- if the generation of the document has already startedvoid startElement(String name)
name
- The name of the tag.void addAttribute(String key, String value)
startElement(String)
key
- The key of the attribute.value
- The value of the attribute.IllegalStateException
- if no element tag is currently in processvoid writeText(String text)
text
- The text which should be written.IllegalStateException
- if no element tag got started yetvoid writeMarkup(String text)
text
- The text which should be written.IllegalStateException
- if no element tag got started yetvoid endElement()
startElement(String)
Copyright © 2002–2016 The Apache Software Foundation. All rights reserved.