org.basex.build.xml
Class XMLParser

java.lang.Object
  extended by org.basex.core.Proc
      extended by org.basex.build.Parser
          extended by org.basex.build.SingleParser
              extended by org.basex.build.xml.XMLParser
Direct Known Subclasses:
HTMLParser, JSONParser

public class XMLParser
extends SingleParser

This class parses the tokens that are delivered by the XMLScanner and sends them to the specified database builder. This class offers a more tolerant alternative to Java's internal SAX parser, which is used by the SAXWrapper class.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Field Summary
 
Fields inherited from class org.basex.build.SingleParser
builder
 
Fields inherited from class org.basex.build.Parser
atts, nsp, prop, src
 
Fields inherited from class org.basex.core.Proc
listen, updating
 
Constructor Summary
XMLParser(IO source, Prop pr)
          Constructor.
XMLParser(IO source, Prop pr, boolean frag)
          Constructor.
 
Method Summary
 void close()
          Closes the parser.
protected  java.lang.String det()
          Returns short information on this process.
 void parse()
          Parses the current input.
 double prog()
          Returns a progress value (0 - 1).
 
Methods inherited from class org.basex.build.SingleParser
builder, parse
 
Methods inherited from class org.basex.build.Parser
emptyParser, info, singleParser, target, xmlParser
 
Methods inherited from class org.basex.core.Proc
abort, checkStop, databases, detail, listen, proc, progress, registered, registered, startTimeout, stop, stopTimeout, tit, title
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLParser

public XMLParser(IO source,
                 Prop pr)
          throws java.io.IOException
Constructor.

Parameters:
source - document source
pr - database properties
Throws:
java.io.IOException - I/O exception

XMLParser

public XMLParser(IO source,
                 Prop pr,
                 boolean frag)
          throws java.io.IOException
Constructor.

Parameters:
source - document source
pr - database properties
frag - allow parsing of document fragment
Throws:
java.io.IOException - I/O exception
Method Detail

parse

public final void parse()
                 throws java.io.IOException
Description copied from class: SingleParser
Parses the current input.

Specified by:
parse in class SingleParser
Throws:
java.io.IOException - I/O exception

close

public void close()
           throws java.io.IOException
Description copied from class: Parser
Closes the parser.

Overrides:
close in class Parser
Throws:
java.io.IOException - I/O exception

det

protected final java.lang.String det()
Description copied from class: Proc
Returns short information on this process.

Overrides:
det in class Proc
Returns:
header information

prog

public final double prog()
Description copied from class: Proc
Returns a progress value (0 - 1). Can be overwritten to give more detailed information.

Overrides:
prog in class Proc
Returns:
header information