org.xmlcml.test
Class SAXAtomCounter

java.lang.Object
  |
  +--org.xml.sax.HandlerBase
        |
        +--uk.co.demon.ursus.dom.SAXAdapter
              |
              +--org.xmlcml.test.SAXAtomCounter

public class SAXAtomCounter
extends SAXAdapter


Fields inherited from class uk.co.demon.ursus.dom.SAXAdapter
AELFRED, defaultParserClassName, defaultParserType, DXP, LARK, MSXML, nParserTypes, parser, parserTypeStrings, reader, urlString, XERCESNV, XERCESSAX, XML4J, XP
 
Constructor Summary
SAXAtomCounter(java.lang.String url)
          read a URL and parse it.
 
Method Summary
 void endDocument()
          end of document
 void endElement(java.lang.String name)
          called for each endtag
static void main(java.lang.String[] args)
          Main entry point for an application.
 void startDocument()
          called when the document starts
 void startElement(java.lang.String name, org.xml.sax.AttributeList atts)
          called when a start tag is found.
 
Methods inherited from class uk.co.demon.ursus.dom.SAXAdapter
addAttributes, attributeString, characters, elementCounter, error, fatalError, getErrorMessage, ignorableWhitespace, notationDecl, parse, parse, parse, processingInstruction, resolveEntity, setDocumentLocator, setParser, setParser, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAXAtomCounter

public SAXAtomCounter(java.lang.String url)
               throws java.lang.Exception
read a URL and parse it. The parsing fires events to the callbacks
Parameters:
String - url the URL to parse
Method Detail

startDocument

public void startDocument()
called when the document starts
Overrides:
startDocument in class SAXAdapter
Tags copied from class: SAXAdapter
Throws:
org.xml.sax.SAXException - IO problems or parsing errors
See Also:
DocumentHandler.startDocument()

startElement

public void startElement(java.lang.String name,
                         org.xml.sax.AttributeList atts)
called when a start tag is found. We will act upon the tagName and identify the element from its attributes
Overrides:
startElement in class SAXAdapter
Parameters:
String - name the tagName
AttributeList - atts list of attributes

endElement

public void endElement(java.lang.String name)
called for each endtag
Overrides:
endElement in class SAXAdapter
Tags copied from class: SAXAdapter
Parameters:
name - The element type name.
attributes - The specified or defaulted attributes.
Throws:
org.xml.sax.SAXException - IO problems or parsing errors
See Also:
DocumentHandler.endElement(java.lang.String)

endDocument

public void endDocument()
end of document
Overrides:
endDocument in class SAXAdapter
Tags copied from class: SAXAdapter
Throws:
org.xml.sax.SAXException - IO problems or parsing errors
See Also:
DocumentHandler.endDocument()

main

public static void main(java.lang.String[] args)
Description copied from class: SAXAdapter
Main entry point for an application.
Tags copied from class: SAXAdapter
Throws:
java.lang.Exception - almost anything in the galaxy could go wrong