gnu.xml

Class ParsedXMLHandler

Known Direct Subclasses:
ParsedXMLToConsumer

public class ParsedXMLHandler
extends java.lang.Object

Handle the output from XMLParser, or other char-array-oriented XML source.

Method Summary

void
emitBeginAttribute(char[] name, int start, int length)
Process an attribute, with the given attribute name.
void
emitBeginElement(char[] name, int start, int length)
Process a start tag, with the given element name.
void
emitCDATA(char[] text, int start, int length)
Process a CDATA section.
void
emitCharacterReference(int value, char[] name, int start, int length)
Process a character entity reference.
void
emitCharacters(char[] text, int start, int length)
Process raw text.
void
emitComment(char[] data, int start, int length)
Process a comment.
void
emitDoctypeDecl(char[] buffer, int target, int tlength, int data, int dlength)
Process a DOCTYPE declaration.
void
emitEndAttributes()
Process the end of a start tag.
void
emitEndElement(char[] name, int start, int length)
Process an end tag.
void
emitEntityReference(char[] name, int start, int length)
Process an entity reference.
void
emitProcessingInstruction(char[] buffer, int target, int tlength, int data, int dlength)
Process a processing incluction.
void
error(XMLParserChar parser, String message)
static void
error(XMLParserChar parser, String message, StringBuffer sbuf)

Method Details

emitBeginAttribute

public void emitBeginAttribute(char[] name,
                               int start,
                               int length)
Process an attribute, with the given attribute name. The attribute value is given using emitCharacters. The value is terminated by either another emitBeginAttribute or an emitEndAttributes.

emitBeginElement

public void emitBeginElement(char[] name,
                             int start,
                             int length)
Process a start tag, with the given element name.

emitCDATA

public void emitCDATA(char[] text,
                      int start,
                      int length)
Process a CDATA section. The data (starting at start for length chars). Does not include the delimiters (i.e. "<![CDATA[" and "]]>" are excluded).

emitCharacterReference

public void emitCharacterReference(int value,
                                   char[] name,
                                   int start,
                                   int length)
Process a character entity reference. The string encoding of the character (e.g. "xFF" or "255") is given, as well as the character value.

emitCharacters

public void emitCharacters(char[] text,
                           int start,
                           int length)
Process raw text.

emitComment

public void emitComment(char[] data,
                        int start,
                        int length)
Process a comment. The data (starting at start for length chars). Does not include the delimiters (i.e. "<!--" and "-->" are excluded).

emitDoctypeDecl

public void emitDoctypeDecl(char[] buffer,
                            int target,
                            int tlength,
                            int data,
                            int dlength)
Process a DOCTYPE declaration.

emitEndAttributes

public void emitEndAttributes()
Process the end of a start tag. There are no more attributes.

emitEndElement

public void emitEndElement(char[] name,
                           int start,
                           int length)
Process an end tag. An abbrevated tag (such as '
') has a name==null.

emitEntityReference

public void emitEntityReference(char[] name,
                                int start,
                                int length)
Process an entity reference. The entity name is given.

emitProcessingInstruction

public void emitProcessingInstruction(char[] buffer,
                                      int target,
                                      int tlength,
                                      int data,
                                      int dlength)
Process a processing incluction.

error

public void error(XMLParserChar parser,
                  String message)

error

public static void error(XMLParserChar parser,
                         String message,
                         StringBuffer sbuf)