Package javanet.staxutils.io
Class XMLWriterUtils
- java.lang.Object
-
- javanet.staxutils.io.XMLWriterUtils
-
public final class XMLWriterUtils extends Object
Set of utility methods useful when writing XML.- Version:
- $Revision: 1.6 $
- Author:
- Christian Niles
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
writeAttribute(QName name, String value, Writer writer)
Writes an attribute to the provided stream.static void
writeAttribute(Attribute attr, Writer writer)
Writes anAttribute
to the provided stream.static void
writeAttribute(Attribute attr, XMLStreamWriter writer)
Writes anAttribute
to the provided stream.static void
writeCData(char[] data, int start, int length, Writer writer)
Writes aCharacters
to the provided stream.static void
writeCData(String text, Writer writer)
Writes aCharacters
to the provided stream.static void
writeCharacters(char[] data, int start, int length, Writer writer)
Writes a chunk of encoded text to the provided stream.static void
writeCharacters(CharSequence text, Writer writer)
Writes a chunk of encoded text to the provided stream.static void
writeCharacters(Characters chars, Writer writer)
Writes aCharacters
to the provided stream.static void
writeCharacters(Characters chars, XMLStreamWriter writer)
Writes aCharacters
to the provided stream.static void
writeComment(String comment, Writer writer)
Writes a comment to the provided stream.static void
writeComment(Comment comment, Writer writer)
Writes aComment
to the provided stream.static void
writeComment(Comment comment, XMLStreamWriter writer)
Writes aComment
to the provided stream.static void
writeDTD(String dtd, Writer writer)
Writes a dtd to the provided stream.static void
writeDTD(DTD dtd, Writer writer)
Writes aDTD
to the provided stream.static void
writeDTD(DTD dtd, XMLStreamWriter writer)
Writes aDTD
to the provided stream.static void
writeEncodedCharacter(char c, Writer writer)
Encodes the provided character if needed, and writes it to an output stream.static void
writeEncodedQuotedValue(String value, Writer writer)
Encodes the given value and writes it to the provided stream, wrapping it in the appropriate quote character.static void
writeEncodedText(char[] text, int start, int len, Writer writer)
static void
writeEncodedText(CharSequence text, Writer writer)
Encodes the provided text and writes it to the provided stream.static void
writeEncodedValue(String value, char quoteChar, Writer writer)
Encodes the given value, and writes it to the stream, but does not actually wrap the value in the quote character.static void
writeEndDocument(Writer writer)
Writes an document ending to the provided stream.static void
writeEndDocument(EndDocument end, Writer writer)
Writes anEndDocument
to the provided stream.static void
writeEndDocument(EndDocument end, XMLStreamWriter writer)
Writes anEndDocument
to the provided stream.static void
writeEndElement(QName name, Writer writer)
Writes an element end tag to the provided stream.static void
writeEndElement(EndElement end, Writer writer)
Writes anEndElement
to the provided stream.static void
writeEndElement(EndElement end, XMLStreamWriter writer)
Writes anEndElement
to the provided stream.static void
writeEntityDeclaration(String name, String text, String notation, Writer writer)
Writes an internal entity declaration to the stream.static void
writeEntityDeclaration(String name, String publicId, String systemId, String notation, Writer writer)
Writes an external entity declaration to the stream.static void
writeEntityDeclaration(EntityDeclaration declaration, Writer writer)
Writes anEntityDeclaration
to the stream.static void
writeEntityReference(String entityRef, Writer writer)
Writes an entity reference to the provided stream.static void
writeEntityReference(EntityReference entityRef, Writer writer)
Writes anEntityReference
to the provided stream.static void
writeEntityReference(EntityReference entityRef, XMLStreamWriter writer)
Writes anEntityReference
to the provided stream.static void
writeEvent(XMLEvent event, Writer writer)
Writes the given event to the providedWriter
.static void
writeEvent(XMLEvent event, XMLStreamWriter writer)
Writes the given event to the providedXMLStreamWriter
.static void
writeNamespace(String prefix, String uri, Writer writer)
Writes aNamespace
to the provided stream.static void
writeNamespace(Namespace ns, Writer writer)
Writes aNamespace
to the provided stream.static void
writeNamespace(Namespace ns, XMLStreamWriter writer)
Writes aNamespace
to the provided stream.static void
writeNotationDeclaration(String name, String publicId, String systemId, Writer writer)
Writes a notation declaration to the stream.static void
writeNotationDeclaration(NotationDeclaration declaration, Writer writer)
Writes aNotationDeclaration
to the stream.static void
writeProcessingInstruction(String target, String data, Writer writer)
Writes aProcessingInstruction
to the provided stream.static void
writeProcessingInstruction(ProcessingInstruction procInst, Writer writer)
Writes aProcessingInstruction
to the provided stream.static void
writeProcessingInstruction(ProcessingInstruction procInst, XMLStreamWriter writer)
Writes aProcessingInstruction
to the provided stream.static void
writeQName(String prefix, String localPart, Writer writer)
Writes a qualified name to the provided stream.static void
writeQName(QName name, Writer writer)
Writes a qualified name to the provided stream.static void
writeQuotedValue(String value, Writer writer)
Writes a quoted version of the given value, automatically determining the appropriate quote character.static void
writeStartDocument(Writer writer)
Writes a default XML declaration to the provided stream.static void
writeStartDocument(String version, Writer writer)
Writes an XML declaration to the provided stream.static void
writeStartDocument(String version, String encoding, boolean standalone, Writer writer)
Writes an XML declaration to the provided stream.static void
writeStartDocument(String version, String encoding, Writer writer)
Writes an XML declaration to the provided stream.static void
writeStartDocument(String version, String encoding, String standalone, Writer writer)
Writes an XML declaration to the provided stream.static void
writeStartDocument(StartDocument start, Writer writer)
Writes aStartDocument
to the provided stream.static void
writeStartDocument(StartDocument start, XMLStreamWriter writer)
Writes aStartDocument
to the provided stream.static void
writeStartElement(QName name, Iterator attributes, Iterator namespaces, boolean empty, Writer writer)
Writes a start tag and any associated namespaces and attributes to the provided stream.static void
writeStartElement(QName name, Iterator attributes, Iterator namespaces, Writer writer)
Writes a start tag and any associated namespaces and attributes to the provided stream.static void
writeStartElement(QName name, Map attributes, Map namespaces, boolean empty, Writer writer)
Writes a start tag and any associated namespaces and attributes to the provided stream.static void
writeStartElement(StartElement start, boolean empty, Writer writer)
Writes aStartElement
event to the provided stream.static void
writeStartElement(StartElement start, boolean empty, XMLStreamWriter writer)
Writes aStartElement
event to the provided stream.static void
writeStartElement(StartElement start, Writer writer)
Writes aStartElement
event to the provided stream.
-
-
-
Method Detail
-
writeQuotedValue
public static final void writeQuotedValue(String value, Writer writer) throws IOException
Writes a quoted version of the given value, automatically determining the appropriate quote character. The value will not be encoded before being written. This method is useful when writing quoted DTD values, such as system IDs.- Parameters:
value
- The value to quote and output.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeEncodedQuotedValue
public static final void writeEncodedQuotedValue(String value, Writer writer) throws IOException
Encodes the given value and writes it to the provided stream, wrapping it in the appropriate quote character. This method is useful when writing attribute values, and entity replacement text.- Parameters:
value
- The value to encode, quote, and output.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeEncodedValue
public static final void writeEncodedValue(String value, char quoteChar, Writer writer) throws IOException
Encodes the given value, and writes it to the stream, but does not actually wrap the value in the quote character. The provided quote character is used to determine whether a character must be encoded or not.- Parameters:
value
- The value to encode and output.quoteChar
- The quote character; used to determine which characters need to be encoded.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeEncodedText
public static final void writeEncodedText(CharSequence text, Writer writer) throws IOException
Encodes the provided text and writes it to the provided stream. This method is useful when writing character data, such as element text or CData sections, and will not encode single or double quotes.- Parameters:
text
- The text to write.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeEncodedText
public static final void writeEncodedText(char[] text, int start, int len, Writer writer) throws IOException
- Throws:
IOException
-
writeEncodedCharacter
public static final void writeEncodedCharacter(char c, Writer writer) throws IOException
Encodes the provided character if needed, and writes it to an output stream.- Parameters:
c
- The character to encode and output.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeQName
public static final void writeQName(QName name, Writer writer) throws IOException
Writes a qualified name to the provided stream.- Parameters:
name
- The name to write.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeQName
public static final void writeQName(String prefix, String localPart, Writer writer) throws IOException
Writes a qualified name to the provided stream.- Parameters:
prefix
- The prefix, ornull
localPart
- The local part.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeEvent
public static final void writeEvent(XMLEvent event, Writer writer) throws IOException, XMLStreamException
Writes the given event to the providedWriter
. This method will delegate the actual task of writing to the stream to the appropriate overloaded method.- Parameters:
event
- The event to write.writer
- The destination XML stream.- Throws:
IOException
- If an error occurs writing to the stream.XMLStreamException
- If the event is a StartElement and an error occurs writing the Namespace or Attribute events.IllegalArgumentException
- If the event is an unknown type.
-
writeStartDocument
public static final void writeStartDocument(StartDocument start, Writer writer) throws IOException
Writes aStartDocument
to the provided stream.- Parameters:
start
- TheStartDocument
to write.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeStartDocument
public static final void writeStartDocument(Writer writer) throws IOException
Writes a default XML declaration to the provided stream.- Parameters:
writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeStartDocument
public static final void writeStartDocument(String version, Writer writer) throws IOException
Writes an XML declaration to the provided stream.- Parameters:
version
- The xml version definition.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeStartDocument
public static final void writeStartDocument(String version, String encoding, Writer writer) throws IOException
Writes an XML declaration to the provided stream.- Parameters:
version
- The xml version definition.encoding
- The document encoding, ornull
writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeStartDocument
public static final void writeStartDocument(String version, String encoding, boolean standalone, Writer writer) throws IOException
Writes an XML declaration to the provided stream.- Parameters:
version
- The xml version definition.encoding
- The document encoding, ornull
standalone
- The standalone definitionwriter
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeStartDocument
public static final void writeStartDocument(String version, String encoding, String standalone, Writer writer) throws IOException
Writes an XML declaration to the provided stream.- Parameters:
version
- The xml version definition.encoding
- The document encoding, ornull
standalone
- The standalone definition, ornull
writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeEndDocument
public static final void writeEndDocument(EndDocument end, Writer writer) throws IOException
Writes anEndDocument
to the provided stream.- Parameters:
end
- TheEndDocument
to write.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeEndDocument
public static final void writeEndDocument(Writer writer) throws IOException
Writes an document ending to the provided stream.- Parameters:
writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeStartElement
public static final void writeStartElement(StartElement start, Writer writer) throws IOException, XMLStreamException
Writes aStartElement
event to the provided stream.- Parameters:
start
- TheStartElement
event to write.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.XMLStreamException
- If an error occurs writing any namespaces or attribute events.
-
writeStartElement
public static final void writeStartElement(StartElement start, boolean empty, Writer writer) throws IOException, XMLStreamException
Writes aStartElement
event to the provided stream.- Parameters:
start
- TheStartElement
event to write.empty
- Whether the element is empty.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.XMLStreamException
- If an error occurs writing any namespaces or attribute events.
-
writeStartElement
public static final void writeStartElement(QName name, Iterator attributes, Iterator namespaces, Writer writer) throws IOException, XMLStreamException
Writes a start tag and any associated namespaces and attributes to the provided stream.- Parameters:
name
- The tag name.attributes
- AnAttribute
iterator, ornull
.namespaces
- ANamespace
iterator, ornull
.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.XMLStreamException
- If an error occurs writing any namespaces or attribute events.
-
writeStartElement
public static final void writeStartElement(QName name, Iterator attributes, Iterator namespaces, boolean empty, Writer writer) throws IOException, XMLStreamException
Writes a start tag and any associated namespaces and attributes to the provided stream.- Parameters:
name
- The tag name.attributes
- AnAttribute
iterator, ornull
.namespaces
- ANamespace
iterator, ornull
.empty
- Whether the element is empty.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.XMLStreamException
-
writeStartElement
public static final void writeStartElement(QName name, Map attributes, Map namespaces, boolean empty, Writer writer) throws IOException
Writes a start tag and any associated namespaces and attributes to the provided stream.- Parameters:
name
- The tag name.attributes
- AMap
of attribute values, keyed by theirQName
s. If no attributes are present, this may be null.namespaces
- AMap
of namespace values, keyed by their prefixes. If no namespaces are present, this may be null.empty
- Whether the element is empty.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeAttribute
public static final void writeAttribute(Attribute attr, Writer writer) throws IOException
Writes anAttribute
to the provided stream.- Parameters:
attr
- TheAttribute
to write.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeAttribute
public static final void writeAttribute(QName name, String value, Writer writer) throws IOException
Writes an attribute to the provided stream.- Parameters:
name
- The attribute name.value
- The attribute value.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeNamespace
public static final void writeNamespace(Namespace ns, Writer writer) throws IOException
Writes aNamespace
to the provided stream.- Parameters:
ns
- TheNamespace
to write.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeNamespace
public static final void writeNamespace(String prefix, String uri, Writer writer) throws IOException
Writes aNamespace
to the provided stream.- Parameters:
prefix
- The namespace prefix, which may benull
.uri
- The namespace uri.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeEndElement
public static final void writeEndElement(EndElement end, Writer writer) throws IOException
Writes anEndElement
to the provided stream.- Parameters:
end
- TheEndElement
to write.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeEndElement
public static final void writeEndElement(QName name, Writer writer) throws IOException
Writes an element end tag to the provided stream.- Parameters:
name
- The element name.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeCharacters
public static final void writeCharacters(Characters chars, Writer writer) throws IOException
Writes aCharacters
to the provided stream.- Parameters:
chars
- TheCharacters
to write.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeCharacters
public static final void writeCharacters(CharSequence text, Writer writer) throws IOException
Writes a chunk of encoded text to the provided stream.- Parameters:
text
- The text to write.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeCharacters
public static final void writeCharacters(char[] data, int start, int length, Writer writer) throws IOException
Writes a chunk of encoded text to the provided stream.- Parameters:
data
- A character array containing the characters.start
- The starting index into the array.length
- The number of characters to write.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeCData
public static final void writeCData(String text, Writer writer) throws IOException
Writes aCharacters
to the provided stream.- Parameters:
text
- The CData text to write.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeCData
public static final void writeCData(char[] data, int start, int length, Writer writer) throws IOException
Writes aCharacters
to the provided stream.- Parameters:
data
- A character array containing the cdata text.start
- The starting index into the array.length
- The number of characters to write.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeComment
public static final void writeComment(Comment comment, Writer writer) throws IOException
Writes aComment
to the provided stream.- Parameters:
comment
- TheComment
to write.writer
- The destination stream.- Throws:
XMLStreamException
- If an error occurs writing to the stream.IOException
-
writeComment
public static final void writeComment(String comment, Writer writer) throws IOException
Writes a comment to the provided stream.- Parameters:
comment
- The comment text.writer
- The destination stream.- Throws:
XMLStreamException
- If an error occurs writing to the stream.IOException
-
writeEntityReference
public static final void writeEntityReference(EntityReference entityRef, Writer writer) throws IOException
Writes anEntityReference
to the provided stream.- Parameters:
entityRef
- TheEntityReference
to write.writer
- The destination stream.- Throws:
XMLStreamException
- If an error occurs writing to the stream.IOException
-
writeEntityReference
public static final void writeEntityReference(String entityRef, Writer writer) throws IOException
Writes an entity reference to the provided stream.- Parameters:
entityRef
- The name of the entity reference.writer
- The destination stream.- Throws:
XMLStreamException
- If an error occurs writing to the stream.IOException
-
writeEntityDeclaration
public static final void writeEntityDeclaration(EntityDeclaration declaration, Writer writer) throws IOException
Writes anEntityDeclaration
to the stream.- Parameters:
declaration
- TheEntityDeclaration
to write.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeEntityDeclaration
public static final void writeEntityDeclaration(String name, String publicId, String systemId, String notation, Writer writer) throws IOException
Writes an external entity declaration to the stream. Either or both of thepublicId
andsystemId
parameters must be non-null
.- Parameters:
name
- The entity name.publicId
- The entity public ID, ornull
.systemId
- The entity system ID, ornull
.notation
- The notation name, ornull
.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeEntityDeclaration
public static final void writeEntityDeclaration(String name, String text, String notation, Writer writer) throws IOException
Writes an internal entity declaration to the stream.- Parameters:
name
- The entity name.text
- The entity replacement text.notation
- The notation name, ornull
.writer
-- Throws:
IOException
-
writeNotationDeclaration
public static final void writeNotationDeclaration(NotationDeclaration declaration, Writer writer) throws IOException
Writes aNotationDeclaration
to the stream.- Parameters:
declaration
- TheNotationDeclaration
to write.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeNotationDeclaration
public static final void writeNotationDeclaration(String name, String publicId, String systemId, Writer writer) throws IOException
Writes a notation declaration to the stream. Either or both of thepublicId
andsystemId
parameters must be non-null
.- Parameters:
name
- The notation name.publicId
- The entity public ID, ornull
.systemId
- The entity system ID, ornull
.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeProcessingInstruction
public static final void writeProcessingInstruction(ProcessingInstruction procInst, Writer writer) throws IOException
Writes aProcessingInstruction
to the provided stream.- Parameters:
procInst
- TheProcessingInstruction
to write.writer
- The destination stream.- Throws:
XMLStreamException
- If an error occurs writing to the stream.IOException
-
writeProcessingInstruction
public static final void writeProcessingInstruction(String target, String data, Writer writer) throws IOException
Writes aProcessingInstruction
to the provided stream.- Parameters:
target
- The instruction target.data
- The instruction data, ornull
.writer
- The destination stream.- Throws:
XMLStreamException
- If an error occurs writing to the stream.IOException
-
writeDTD
public static final void writeDTD(DTD dtd, Writer writer) throws IOException
Writes aDTD
to the provided stream.- Parameters:
dtd
- TheDTD
to write.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeDTD
public static final void writeDTD(String dtd, Writer writer) throws IOException
Writes a dtd to the provided stream.- Parameters:
dtd
- The dtd to write.writer
- The destination stream.- Throws:
IOException
- If an error occurs writing to the stream.
-
writeEvent
public static final void writeEvent(XMLEvent event, XMLStreamWriter writer) throws XMLStreamException
Writes the given event to the providedXMLStreamWriter
. This method will delegate the actual task of writing to the stream to the appropriate overloaded method.- Parameters:
event
- The event to write.writer
- The destination XML stream.- Throws:
XMLStreamException
- If an error occurs writing the event.
-
writeStartElement
public static final void writeStartElement(StartElement start, boolean empty, XMLStreamWriter writer) throws XMLStreamException
Writes aStartElement
event to the provided stream.- Parameters:
start
- TheStartElement
event to write.empty
- Whether the element is empty.writer
- The destination stream.- Throws:
XMLStreamException
- If an error occurs writing to the stream.
-
writeEndElement
public static final void writeEndElement(EndElement end, XMLStreamWriter writer) throws XMLStreamException
Writes anEndElement
to the provided stream.- Parameters:
end
- TheEndElement
to write.writer
- The destination stream.- Throws:
XMLStreamException
- If an error occurs writing to the stream.
-
writeAttribute
public static final void writeAttribute(Attribute attr, XMLStreamWriter writer) throws XMLStreamException
Writes anAttribute
to the provided stream.- Parameters:
attr
- TheAttribute
to write.writer
- The destination stream.- Throws:
XMLStreamException
- If an error occurs writing to the stream.
-
writeNamespace
public static final void writeNamespace(Namespace ns, XMLStreamWriter writer) throws XMLStreamException
Writes aNamespace
to the provided stream.- Parameters:
ns
- TheNamespace
to write.writer
- The destination stream.- Throws:
XMLStreamException
- If an error occurs writing to the stream.
-
writeStartDocument
public static final void writeStartDocument(StartDocument start, XMLStreamWriter writer) throws XMLStreamException
Writes aStartDocument
to the provided stream.- Parameters:
start
- TheStartDocument
to write.writer
- The destination stream.- Throws:
XMLStreamException
- If an error occurs writing to the stream.
-
writeEndDocument
public static final void writeEndDocument(EndDocument end, XMLStreamWriter writer) throws XMLStreamException
Writes anEndDocument
to the provided stream.- Parameters:
end
- TheEndDocument
to write.writer
- The destination stream.- Throws:
XMLStreamException
- If an error occurs writing to the stream.
-
writeCharacters
public static final void writeCharacters(Characters chars, XMLStreamWriter writer) throws XMLStreamException
Writes aCharacters
to the provided stream.- Parameters:
chars
- TheCharacters
to write.writer
- The destination stream.- Throws:
XMLStreamException
- If an error occurs writing to the stream.
-
writeComment
public static final void writeComment(Comment comment, XMLStreamWriter writer) throws XMLStreamException
Writes aComment
to the provided stream.- Parameters:
comment
- TheComment
to write.writer
- The destination stream.- Throws:
XMLStreamException
- If an error occurs writing to the stream.
-
writeEntityReference
public static final void writeEntityReference(EntityReference entityRef, XMLStreamWriter writer) throws XMLStreamException
Writes anEntityReference
to the provided stream.- Parameters:
entityRef
- TheEntityReference
to write.writer
- The destination stream.- Throws:
XMLStreamException
- If an error occurs writing to the stream.
-
writeProcessingInstruction
public static final void writeProcessingInstruction(ProcessingInstruction procInst, XMLStreamWriter writer) throws XMLStreamException
Writes aProcessingInstruction
to the provided stream.- Parameters:
procInst
- TheProcessingInstruction
to write.writer
- The destination stream.- Throws:
XMLStreamException
- If an error occurs writing to the stream.
-
writeDTD
public static final void writeDTD(DTD dtd, XMLStreamWriter writer) throws XMLStreamException
Writes aDTD
to the provided stream.- Parameters:
dtd
- TheDTD
to write.writer
- The destination stream.- Throws:
XMLStreamException
- If an error occurs writing to the stream.
-
-