com.lowagie.text.xml.simpleparser
Class SimpleXMLParser

java.lang.Object
  extended by com.lowagie.text.xml.simpleparser.SimpleXMLParser

public final class SimpleXMLParser
extends java.lang.Object

A simple XML and HTML parser. This parser is, like the SAX parser, an event based parser, but with much less functionality.

The parser can:


Method Summary
static java.lang.String escapeXML(java.lang.String s, boolean onlyASCII)
          Escapes a string with the appropriated XML codes.
static void parse(SimpleXMLDocHandler doc, java.io.InputStream in)
          Parses the XML document firing the events to the handler.
static void parse(SimpleXMLDocHandler doc, java.io.Reader r)
           
static void parse(SimpleXMLDocHandler doc, SimpleXMLDocHandlerComment comment, java.io.Reader r, boolean html)
          Parses the XML document firing the events to the handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parse

public static void parse(SimpleXMLDocHandler doc,
                         SimpleXMLDocHandlerComment comment,
                         java.io.Reader r,
                         boolean html)
                  throws java.io.IOException
Parses the XML document firing the events to the handler.

Parameters:
doc - the document handler
r - the document. The encoding is already resolved. The reader is not closed
Throws:
java.io.IOException - on error

parse

public static void parse(SimpleXMLDocHandler doc,
                         java.io.InputStream in)
                  throws java.io.IOException
Parses the XML document firing the events to the handler.

Parameters:
doc - the document handler
in - the document. The encoding is deduced from the stream. The stream is not closed
Throws:
java.io.IOException - on error

parse

public static void parse(SimpleXMLDocHandler doc,
                         java.io.Reader r)
                  throws java.io.IOException
Throws:
java.io.IOException

escapeXML

public static java.lang.String escapeXML(java.lang.String s,
                                         boolean onlyASCII)
Escapes a string with the appropriated XML codes.

Parameters:
s - the string to be escaped
onlyASCII - codes above 127 will always be escaped with &#nn; if true
Returns:
the escaped string


iText 2.1.7