public interface XMLWriter extends ContentHandler
This writer outputs well-formated XML data and encodes text data as necessary.
This interface is not intended to be implemented by clients.
XMLUtils.createWriter(File)
Modifier and Type | Method and Description |
---|---|
void |
characters(String text)
Receives notification of character data.
|
Attributes |
createAttributes(String[] nameAndValues)
Creates an XML
Attributes for the specified names and values. |
Attributes |
createAttributes(String name,
String value)
Creates a singleton XML
Attributes for the specified name and value. |
void |
dataElement(String qName,
String data)
Receives notification of the element with data information but whithout attributes and child.
|
void |
dataElement(String uri,
String localName,
String data)
Receives notification of the element with data information but whithout attributes and child.
|
void |
emptyElement(String qName,
Attributes attrs)
Receives notification of the element without data information and whithout child.
|
void |
emptyElement(String uri,
String localName,
Attributes attrs)
Receives notification of the element without data information and whithout child.
|
void |
endElement(String qName)
Receives notification of the end of an element.
|
void |
endElement(String uri,
String localName)
Receives notification of the end of an element.
|
void |
startElement(String qName)
Receives notification of the beginning of an element.
|
void |
startElement(String qName,
Attributes attrs)
Receives notification of the beginning of an element containing attributes.
|
void |
startElement(String uri,
String localName)
Receives notification of the beginning of an element.
|
void |
startElement(String uri,
String localName,
Attributes attrs)
Receives notification of the beginning of an element containing attributes.
|
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping
Attributes createAttributes(String name, String value)
Attributes
for the specified name and value.name
- the attribute name.value
- the attribute value.Attributes
.Attributes createAttributes(String[] nameAndValues)
Attributes
for the specified names and values.
The specified array must contains pairs of names and values (["name", aNameValue, "id", anID]
for example). null
values are ignored and won't appear in the XML document.
nameAndValues
- the attributes name and values.Attributes
.void characters(String text) throws SAXException
text
- the text data to write.SAXException
- any SAX exception, possibly wrapping another exception.void dataElement(String qName, String data) throws SAXException
This method can be used if the XML document does not contain namespaces.
qName
- the qualified name (with prefix).data
- the element text information.SAXException
- any SAX exception, possibly wrapping another exception.void dataElement(String uri, String localName, String data) throws SAXException
This method can be used if the XML document contains namespaces.
uri
- the Namespace URI.localName
- the local name (without prefix).data
- the element text information.SAXException
- any SAX exception, possibly wrapping another exception.void emptyElement(String qName, Attributes attrs) throws SAXException
This method can be used if the XML document does not contain namespaces.
qName
- the qualified name (with prefix).attrs
- the attributes attached to the element.SAXException
- any SAX exception, possibly wrapping another exception.void emptyElement(String uri, String localName, Attributes attrs) throws SAXException
This method can be used if the XML document contains namespaces.
uri
- the Namespace URI.localName
- the local name (without prefix).attrs
- the attributes attached to the element.SAXException
- any SAX exception, possibly wrapping another exception.void startElement(String qName) throws SAXException
This method can be used if the XML document does not contain namespaces and if the XML element has no attribute.
qName
- the qualified name (with prefix).SAXException
- any SAX exception, possibly wrapping another exception.void startElement(String qName, Attributes attrs) throws SAXException
This method can be used if the XML document does not contain namespaces.
qName
- the qualified name (with prefix).attrs
- the attributes attached to the element.SAXException
- any SAX exception, possibly wrapping another exception.void startElement(String uri, String localName) throws SAXException
This method can be used if the XML document contains namespaces and if the XML element has no attribute.
uri
- the Namespace URI.localName
- the local name (without prefix).SAXException
- any SAX exception, possibly wrapping another exception.void startElement(String uri, String localName, Attributes attrs) throws SAXException
This method can be used if the XML document contains namespaces.
uri
- the Namespace URI.localName
- the local name (without prefix).attrs
- the attributes attached to the element.SAXException
- any SAX exception, possibly wrapping another exception.void endElement(String qName) throws SAXException
This method can be used if the XML document does not contain namespaces.
qName
- the qualified name (with prefix).SAXException
- any SAX exception, possibly wrapping another exception.void endElement(String uri, String localName) throws SAXException
This method can be used if the XML document contains namespaces.
uri
- the Namespace URI.localName
- the local name (without prefix).SAXException
- any SAX exception, possibly wrapping another exception.