com.itextpdf.text.xml.simpleparser
Class SimpleXMLParser

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

public final class SimpleXMLParser
extends Object

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

The parser can:


Method Summary
static String escapeXML(String s, boolean onlyASCII)
          Deprecated. moved to XMLUtil.escapeXML(String, boolean), left here for the sake of backwards compatibility
static void parse(SimpleXMLDocHandler doc, InputStream in)
          Parses the XML document firing the events to the handler.
static void parse(SimpleXMLDocHandler doc, Reader r)
           
static void parse(SimpleXMLDocHandler doc, SimpleXMLDocHandlerComment comment, 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,
                         Reader r,
                         boolean html)
                  throws IOException
Parses the XML document firing the events to the handler.

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

parse

public static void parse(SimpleXMLDocHandler doc,
                         InputStream in)
                  throws 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:
IOException - on error

parse

public static void parse(SimpleXMLDocHandler doc,
                         Reader r)
                  throws IOException
Parameters:
doc -
r -
Throws:
IOException

escapeXML

@Deprecated
public static String escapeXML(String s,
                                          boolean onlyASCII)
Deprecated. moved to XMLUtil.escapeXML(String, boolean), left here for the sake of backwards compatibility

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


Copyright © 2013. All Rights Reserved.