Qizx/open API

net.axyana.qizxopen.dm
Interface XMLEventReceiver

All Known Implementing Classes:
TreeEncoder, XMLEventReceiverBase

public interface XMLEventReceiver

A SAX-like abstract event handler.

Used for serialization or any kind of tree construction or transformation, in particular "push" style evaluation of XQuery constructors.

All event methods begin with "ev" to avoid clashes with SAX.


Method Summary
 void abort()
          Signals an error in the event flow.
 void definePrefixHints(NSPrefixMapping prefixes)
          Optional: defines a preferred prefix/namespace mapping for serialization.
 void evAtom(java.lang.Object value)
          A special atom with any value (serializable).
 void evAtomText(java.lang.String value)
          Text of an atom.
 void evAttribute(QName name, java.lang.String value)
          Adds an attribute on the current element.
 void evComment(java.lang.String value)
          A comment node.
 void evDocumentEnd()
          Ends a document.
 void evDocumentStart()
          Starts a document.
 void evDTD(java.lang.String name, java.lang.String publicID, java.lang.String systemID)
          DTD definition.
 void evElementEnd(QName name)
          Ends an element.
 void evElementStart(QName name)
          Starts an element.
 void evNamespace(java.lang.String prefix, java.lang.String uri)
          Adds a namespace node on the current element.
 void evPI(java.lang.String target, java.lang.String value)
          A processing-instruction node.
 void evText(java.lang.String value)
          Text chunk inside an element.
 void reset()
          Resets the state prior to use startDocument() or startElement().
 java.lang.String resolvePrefix(java.lang.String prefix)
          Resolves a prefix to an URI in the context of the current node.
 void terminate()
          Terminates a document or simple subtree.
 void traverse(FONIDocument document, int nodeId)
          Convenience method: traverses and generates a FONI document using this receiver.
 void traverse(Node node, boolean inScopeNS)
          Convenience method: traverses and generates a subtree into this receiver.
 

Method Detail

reset

public void reset()
Resets the state prior to use startDocument() or startElement().


terminate

public void terminate()
               throws DataModelException
Terminates a document or simple subtree. May perform consistency checks.

Throws:
DataModelException

abort

public void abort()
           throws DataModelException
Signals an error in the event flow.

Throws:
DataModelException

evDocumentStart

public void evDocumentStart()
                     throws DataModelException
Starts a document.

It is not called in the case only a fragment is generated.

Throws:
DataModelException

evDTD

public void evDTD(java.lang.String name,
                  java.lang.String publicID,
                  java.lang.String systemID)
           throws DataModelException
DTD definition.

Throws:
DataModelException

evDocumentEnd

public void evDocumentEnd()
                   throws DataModelException
Ends a document. Must be balanced by a matching startDocument().

Throws:
DataModelException

evElementStart

public void evElementStart(QName name)
                    throws DataModelException
Starts an element. Must be balanced by a matching endElement().

Throws:
DataModelException

evNamespace

public void evNamespace(java.lang.String prefix,
                        java.lang.String uri)
                 throws DataModelException
Adds a namespace node on the current element. Must follow startElement and precede any child. May be interleaved with attribute().

Throws:
DataModelException

evAttribute

public void evAttribute(QName name,
                        java.lang.String value)
                 throws DataModelException
Adds an attribute on the current element. Must follow startElement and precede any child. May be interleaved with namespace().

Throws:
DataModelException

evElementEnd

public void evElementEnd(QName name)
                  throws DataModelException
Ends an element. Discards prefix/namespace mappings possibly defined by the element.

Throws:
DataModelException

evText

public void evText(java.lang.String value)
            throws DataModelException
Text chunk inside an element. No space is generated before or after.

Throws:
DataModelException

evAtomText

public void evAtomText(java.lang.String value)
                throws DataModelException
Text of an atom. The difference with text() is that a space in requested between two atoms.

Throws:
DataModelException

evPI

public void evPI(java.lang.String target,
                 java.lang.String value)
          throws DataModelException
A processing-instruction node.

Throws:
DataModelException

evComment

public void evComment(java.lang.String value)
               throws DataModelException
A comment node.

Throws:
DataModelException

evAtom

public void evAtom(java.lang.Object value)
            throws DataModelException
A special atom with any value (serializable).

Throws:
DataModelException

traverse

public void traverse(Node node,
                     boolean inScopeNS)
              throws DataModelException
Convenience method: traverses and generates a subtree into this receiver.

Parameters:
inScopeNS - if true, copy all in-scope namespace nodes (not only those defined on the node itself). A false value is generally used.
Throws:
DataModelException

traverse

public void traverse(FONIDocument document,
                     int nodeId)
              throws DataModelException
Convenience method: traverses and generates a FONI document using this receiver.

Throws:
DataModelException

resolvePrefix

public java.lang.String resolvePrefix(java.lang.String prefix)
Resolves a prefix to an URI in the context of the current node.

Returns:
null if the prefix cannot be resolved.

definePrefixHints

public void definePrefixHints(NSPrefixMapping prefixes)
Optional: defines a preferred prefix/namespace mapping for serialization. This table is used when no mapping is in scope in the current context.


© 2005 Axyana Software