gnu.xml

Class XMLParserChar

Known Direct Subclasses:
XMLParser

public class XMLParserChar
extends java.lang.Object

Reads XML from a char array. Assumes a state-less character encoding containing ascii as a sub-set, and where no byte in a multi-byte character is the same as a xml special character. Any bytes with high-order bit set are treated as if they are letters, and can be part of names. Handles CR/LF, CDATA, entity references, processing instructions, DOCTYPE, as well as the obvious (text, element, and attributes).

Field Summary

protected char[]
buffer
protected Reader
in
protected int
limit
protected int
pos

Constructor Summary

XMLParserChar(Reader in, ParsedXMLHandler out)
XMLParserChar(URL url, ParsedXMLHandler out)
XMLParserChar(char[] buffer, int pos, int limit, ParsedXMLHandler out)

Method Summary

void
error(char severity, String message)
int
fill(char[] buffer, int start, int pos)
Fill the buffer with more data.
void
parse()

Field Details

buffer

protected char[] buffer

in

protected Reader in

limit

protected int limit

pos

protected int pos

Constructor Details

XMLParserChar

public XMLParserChar(Reader in,
                     ParsedXMLHandler out)

XMLParserChar

public XMLParserChar(URL url,
                     ParsedXMLHandler out)
            throws IOException

XMLParserChar

public XMLParserChar(char[] buffer,
                     int pos,
                     int limit,
                     ParsedXMLHandler out)

Method Details

error

public void error(char severity,
                  String message)

fill

public int fill(char[] buffer,
                int start,
                int pos)
Fill the buffer with more data.
Parameters:
start - start of current token.
pos - index of current read position

parse

public void parse()