com.ssx.xml.output
Interface XmlOutput

All Known Implementing Classes:
XmlValidator

public interface XmlOutput

Represents a service that accepts a programaticly generated XML document.


Method Summary
 void attribute(String name, String value)
          Add an attribute to the current element using the element namespace.
 void attribute(String prefix, String name, String value)
          Add an attribute to the current element.
 void close()
          End the output.
 void comment(String content)
          Write a comment to the output.
 void endElement()
          End the current element.
 void instruction(String target, String data)
          Add a processing instruction to the output.
 void namespace(String prefix, String name)
          Write a namespace node to the output
 void startElement(String name)
          Start a new element in the output using the default namespace
 void startElement(String prefix, String name)
          Start a new element in the output
 void text(String text)
          Add character data to the output.
 

Method Detail

startElement

public void startElement(String name)
Start a new element in the output using the default namespace

Parameters:
name - The element name
Throws:
XmlOutputException - If the element name is invalid.

startElement

public void startElement(String prefix,
                         String name)
Start a new element in the output

Parameters:
prefix - The namespace prefix
name - The element name
Throws:
XmlOutputException - If the element name is invalid.

namespace

public void namespace(String prefix,
                      String name)
Write a namespace node to the output

Parameters:
prefix - The alias to use for this namespace within the document. use the empty string or null to denote the default namespace.
name - The namespace name

attribute

public void attribute(String name,
                      String value)
Add an attribute to the current element using the element namespace.

Parameters:
name - The attribute name
value - The attribute value
Throws:
XmlOutputException - If the output is not currently within an element start tag or the element name is invalid.

attribute

public void attribute(String prefix,
                      String name,
                      String value)
Add an attribute to the current element.

Parameters:
prefix - The namespace prefix
name - The attribute name
value - The attribute value
Throws:
XmlOutputException - If the output is not currently within an element start tag or the element name is invalid.

endElement

public void endElement()
End the current element.

Throws:
XmlOutputException - If there are no open entities.

text

public void text(String text)
Add character data to the output. Any illegal characters will be escaped using entity references.

Parameters:
text - The text to add as XML character data
Throws:
XmlOutputException - If there is no open element.

instruction

public void instruction(String target,
                        String data)
Add a processing instruction to the output.

Parameters:
target - The name of the PI target.
data - The PI data - may not contain '?>'
Throws:
XmlOutputException - If the data contains '?>' or the target name has invalid characters.

comment

public void comment(String content)
Write a comment to the output.

Parameters:
content - The content of the comment.
Throws:
XmlOutputException - If the comment text contains '-->' or ends in '-'.

close

public void close()
End the output. No more calls are allowed.

Throws:
XmlOutputException - If there are any open entities.