xml
Class XMLScanner

java.lang.Object
  extended by xml.XMLScanner
Direct Known Subclasses:
SiGMLStreamTransmitter

public class XMLScanner
extends java.lang.Object

This class just provides convenient packaging of a JAXP-based SAX 2 XML Parser.

The scanXML(String,DefaultHandler) and scanXMLText(String,DefaultHandler) methods take an XML source and a SAX DefaultHandler (or sub-class instance) as arguments, and invoke the parser on that XML source, resulting in the delivery of a sequence of SAX events to the handler.


Field Summary
static java.lang.String SAX_NAMESPACES
          Tag for the SAX namespaces feature.
static java.lang.String SAX_NS_PREFIXES
          Tag for the SAX namespace-prefixes feature.
static java.lang.String SAX_STRING_INTERN
          Tag for the SAX string-interning feature.
 
Constructor Summary
XMLScanner(java.lang.String intag)
          Constructs a new scanner, with the given input kind tag, and using a validating parser.
XMLScanner(java.lang.String intag, boolean validate)
          Constructs a new scanner, with the given input kind tag, and using the given flag to determine whether or not to use a validating parser.
 
Method Summary
 void scanXML(java.lang.String inuri, org.xml.sax.helpers.DefaultHandler hndlr)
          Applies this scanner's parser to the XML document with the given URI, using the given parse event handler.
 void scanXMLText(java.lang.String txt, org.xml.sax.helpers.DefaultHandler hndlr)
          Applies this scanner's parser to the given XML document text, using the given parse event handler.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SAX_NAMESPACES

public static final java.lang.String SAX_NAMESPACES
Tag for the SAX namespaces feature.

See Also:
Constant Field Values

SAX_NS_PREFIXES

public static final java.lang.String SAX_NS_PREFIXES
Tag for the SAX namespace-prefixes feature.

See Also:
Constant Field Values

SAX_STRING_INTERN

public static final java.lang.String SAX_STRING_INTERN
Tag for the SAX string-interning feature.

See Also:
Constant Field Values
Constructor Detail

XMLScanner

public XMLScanner(java.lang.String intag)
Constructs a new scanner, with the given input kind tag, and using a validating parser.


XMLScanner

public XMLScanner(java.lang.String intag,
                  boolean validate)
Constructs a new scanner, with the given input kind tag, and using the given flag to determine whether or not to use a validating parser.

Method Detail

scanXML

public void scanXML(java.lang.String inuri,
                    org.xml.sax.helpers.DefaultHandler hndlr)
Applies this scanner's parser to the XML document with the given URI, using the given parse event handler.


scanXMLText

public void scanXMLText(java.lang.String txt,
                        org.xml.sax.helpers.DefaultHandler hndlr)
Applies this scanner's parser to the given XML document text, using the given parse event handler.