Devsphere.com


com.devsphere.xml.saxdomix
Interface SDXController

All Known Implementing Classes:
Controller, Controller, DOMOutputter, Handler, SDXTransformer

public interface SDXController

The application implements this interface in order to control the mixed SAX 2.0 - DOM Level 2 parsing.

The com.devsphere.xml.saxdomix.SDXBuilder and com.devsphere.xml.saxdomix.SDXBuilderT classes of the framework provide the mixed SAX 2.0 - DOM Level 2 parsing functionality.

See Also:
SDXBuilder, SDXBuilderT

Method Summary
 void handleDOM(org.w3c.dom.Element element)
          Receives the DOM sub-trees for handling.
 boolean wantDOM(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qualifiedName, org.xml.sax.Attributes attributes)
          Returns true when the application wants to receive a DOM sub-tree for handling.
 

Method Detail

wantDOM

public boolean wantDOM(java.lang.String namespaceURI,
                       java.lang.String localName,
                       java.lang.String qualifiedName,
                       org.xml.sax.Attributes attributes)
                throws org.xml.sax.SAXException
Returns true when the application wants to receive a DOM sub-tree for handling.

During the SAX parsing, a builder object invokes the controller's wantDOM() method for each startElement() parsing event. If wantDOM() returns false the SAX parsing mode continues. When wantDOM() returns true the builder enters in DOM parsing mode and starts creating a DOM sub-tree from all SAX events between the current startElement() and the corresponding endElement().

Parameters:
namespaceURI - The element's namespace URI
localName - The element's local name
qualifiedName - The element's qualified name
attributes - The element's attributes
Returns:
A boolean value indicating whether the builder must enter in DOM parsing mode or must remain in SAX parsing mode
Throws:
org.xml.sax.SAXException - If an error must be signaled

handleDOM

public void handleDOM(org.w3c.dom.Element element)
               throws org.xml.sax.SAXException
Receives the DOM sub-trees for handling.

After wantDOM() returns true, the builder constructs a DOM sub-tree from SAX events and passes it to the controller's handleDOM() method. After handling, the builder returns to the SAX parsing mode.

Parameters:
element - The root of the DOM sub-tree
Throws:
org.xml.sax.SAXException - If an error must be signaled

 Devsphere.com