com.partnersoft.formats.xml
Interface XmlActor

All Known Implementing Classes:
XmlAlternatingElementNamingActor, XmlAttributeValueListingActor, XmlContentListingActor, XmlDoNothingActor

public interface XmlActor

Handles parsing events from an XMLParser.

These methods directly correlate to those in ContentHandler. This is primarily intended to be a simplified version of that interface. It does not handle such advanced XML trickery as namespaces, external entities, etc. It automatically combines character data for you and presents it as a string; this has the unfortunate side effect of limiting character data to 65535 characters (the maximum size of a Java String). If you need something more sophisticated, by all means just use the org.xml.sax framework directly.

Most methods allow you to throw any exception you like; these are then wrapped as SAXExceptions, which are logged by the XMLParser and cause parsing to halt.

Copyright 2006 Partner Software, Inc.

Version:
$Id: XmlActor.java 1012 2007-11-24 18:30:02Z paul $
Author:
Paul Reavis

Method Summary
 void endElement(java.lang.String name, java.lang.String characterData)
          Called when a closing tag is encounterd, ending an element.
 void startElement(java.lang.String name, org.xml.sax.Attributes attributes)
          Called when an opening tag is encountered, starting an element.
 

Method Detail

startElement

void startElement(java.lang.String name,
                  org.xml.sax.Attributes attributes)
                  throws java.lang.Exception
Called when an opening tag is encountered, starting an element. The qName of the tag and the associated attributes are supplied.

Parameters:
name - qName of element
attributes - attributes listed in the tag
Throws:
java.lang.Exception - if anything bad happens (this stops the parsing)

endElement

void endElement(java.lang.String name,
                java.lang.String characterData)
                throws java.lang.Exception
Called when a closing tag is encounterd, ending an element. The qName of the tag and a String containing any character data enclosed are supplied.

Parameters:
name - qName of element
characterData - any character data encountered
Throws:
java.lang.Exception - if anything bad happens (this stops the parsing)