tribble.xml
Interface XmlWriterI

All Known Implementing Classes:
XmlWriter

public interface XmlWriterI

XML document writer.

This interface is used to implement any kind of high-level output stream that writes XML documents. XML documents are written in a "push" fashion, where each item (node tag, attribute, and text content) is written individually by request.

Implementations of this interface should provide at least one constructor that takes some kind of output text stream (such as a java.io.Writer or java.io.OutputStream) as input. For example:

    class MyXmlWriter
        implements tribble.xml.XmlWriterI
    {
        // Constructor
        public MyXmlWriter(java.io.Writer out)
        {
            ...
        }

        ...
    } 

Since:
2003-04-13
Version:
$Revision: 1.2 $ $Date: 2003/04/16 03:16:55 $
Author:
David R. Tribble (david@tribble.com).
Copyright 2003 by David R. Tribble, all rights reserved.
Permission is granted to freely use and distribute this source code provided that the original copyright and authorship notices remain intact.
See Also:
XmlReaderI

Field Summary
static java.lang.String REV
          Revision information.
 
Method Summary
 void writeAttribute(XmlAttributeI attr)
          Write an XML element attribute to this XML output stream.
 void writeComment(java.lang.String text)
          Write a comment to this XML output stream.
 void writeElement(XmlElementI ent)
          Write an XML element to this XML output stream.
 void writeText(java.lang.String text)
          Write the text content of the current XML element to this XML output stream.
 

Field Detail

REV

public static final java.lang.String REV
Revision information.

See Also:
Constant Field Values
Method Detail

writeElement

public void writeElement(XmlElementI ent)
                  throws java.io.IOException
Write an XML element to this XML output stream.

Parameters:
ent - An XML tagged element.
Throws:
java.io.IOException - Thrown if an I/O (write) error occurs.
java.lang.IllegalStateException - (unchecked) Thrown if this writer is not in the proper state for writing an element.
Since:
1.1, 2003-04-13

writeAttribute

public void writeAttribute(XmlAttributeI attr)
                    throws java.io.IOException
Write an XML element attribute to this XML output stream.

Parameters:
attr - An XML element attribute.
Throws:
java.io.IOException - Thrown if an I/O (write) error occurs.
java.lang.IllegalStateException - (unchecked) Thrown if this writer is not in the proper state for writing an element attribute.
Since:
1.1, 2003-04-13

writeText

public void writeText(java.lang.String text)
               throws java.io.IOException
Write the text content of the current XML element to this XML output stream.

Parameters:
text - Text contents of the current XML element.
Throws:
java.io.IOException - Thrown if an I/O (write) error occurs.
java.lang.IllegalStateException - (unchecked) Thrown if this writer is not in the proper state for writing the text contents of an element.
Since:
1.1, 2003-04-13

writeComment

public void writeComment(java.lang.String text)
                  throws java.io.IOException
Write a comment to this XML output stream.

Parameters:
text - Comment text.
Throws:
java.io.IOException - Thrown if an I/O (write) error occurs.
java.lang.IllegalStateException - (unchecked) Thrown if this writer is not in the proper state for writing a comment.
Since:
1.2, 2003-04-15