Qizx/Open v0.4

net.xfra.qizxopen.dm
Interface XMLEventReceiver

All Known Implementing Classes:
XMLEventReceiverBase

public interface XMLEventReceiver

A SAX-like abstract event handler.

Used for serialization and "push" style evaluation of XQuery constructors.


Method Summary
 void atom(java.lang.String value)
          Text of an atom.
 void attribute(QName name, java.lang.String value)
          Adds an attribute on the current element.
 void comment(java.lang.String value)
          A comment node.
 void definePrefixHints(NSPrefixMapping prefixes)
          Optional: defines a preferred prefix/namespace mapping for serialization.
 void endDocument()
          Ends a document.
 void endElement(QName name)
          Ends an element.
 void namespace(java.lang.String prefix, java.lang.String uri)
          Adds a namespace node on the current element.
 void pi(java.lang.String target, java.lang.String value)
          A processing-instruction node.
 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 startDocument()
          Starts a document.
 void startElement(QName name)
          Starts an element.
 void terminate()
          Terminates a document or simple subtree.
 void text(java.lang.String value)
          Text chunk inside an element.
 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.

DataModelException

startDocument

public void startDocument()
                   throws DataModelException
Starts a document.

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

DataModelException

endDocument

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

DataModelException

startElement

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

DataModelException

namespace

public void namespace(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().

DataModelException

attribute

public void attribute(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().

DataModelException

endElement

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

DataModelException

text

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

DataModelException

atom

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

DataModelException

pi

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

DataModelException

comment

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

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 in the node itself).
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.


 Copyright Xavier FRANC 2003-2004