|
Qizx fe-4.4p2 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.qizx.xdm.AttributeList
com.qizx.xdm.XMLPushStreamBase
com.qizx.api.util.PushStreamToDOM
public class PushStreamToDOM
An implementation of XMLPushStream which creates W3C DOM documents or nodes.
This class can be used to export or convert a XML tree from Qizx to any system accepting DOM representation.
Caution: leading and trailing Comments or Processing-Instructions (i.e. preceding or following the topmost Element) are discarded. This feature is in fact not really supported by W3C DOM.
Field Summary |
---|
Fields inherited from interface com.qizx.api.XMLPushStream |
---|
NSCOPY_NOPRESERVE_INHERIT, NSCOPY_NOPRESERVE_NOINHERIT, NSCOPY_PRESERVE_INHERIT, NSCOPY_PRESERVE_NOINHERIT |
Constructor Summary | |
---|---|
PushStreamToDOM()
Creates a DOM output using the default DOM implementation. |
|
PushStreamToDOM(DOMImplementation implem)
Creates a DOM output using a specified DOM implementation. |
Method Summary | |
---|---|
Node |
exportNode(Node node)
Converts a node of the XDM into a W3C DOM node. |
Document |
getResultDocument()
Returns the DOM document built. |
void |
putComment(String contents)
Puts a Comment event. |
boolean |
putDocumentStart()
Puts a Document Start event. |
void |
putElementEnd(QName name)
Puts an Element End event. |
void |
putElementStart(QName name)
Puts an Element Start event. |
void |
putProcessingInstruction(String target,
String contents)
Puts a Processing-instruction event. |
void |
putText(String text)
Puts a Text Fragment event. |
void |
reset()
Resets the state before a new use. |
Methods inherited from class com.qizx.xdm.XMLPushStreamBase |
---|
abort, defineContextMappings, flush, getNSPrefix, getNSURI, isAtRoot, maxVolumeReached, noSpace, putAtom, putAtomText, putAttribute, putChars, putDocumentEnd, putDTD, putLongAtom, putNamespace, putNamespaces, putNodeCopy, putNodeCopy, putNodeText, setCheckNS, setMaxVolume, setTrace |
Methods inherited from class com.qizx.xdm.AttributeList |
---|
addAttribute, getAttributeCount, getIndex, getIndex, getIndex, getLength, getLocalName, getNamespaceContext, getNamespaceCount, getNamespacePrefix, getNamespaceURI, getQName, getType, getType, getType, getURI, getValue, getValue, getValue |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PushStreamToDOM() throws DataModelException
DataModelException
- wraps a ParserConfigurationExceptionpublic PushStreamToDOM(DOMImplementation implem)
implem
- DOM implementationMethod Detail |
---|
public Node exportNode(Node node) throws DataModelException
node
- a Node of the XQuery Data Model.
DataModelException
- not thrownpublic Document getResultDocument()
public boolean putDocumentStart() throws DataModelException
XMLPushStream
putDocumentStart
in interface XMLPushStream
putDocumentStart
in class com.qizx.xdm.XMLPushStreamBase
DataModelException
- reasonspublic void putElementStart(QName name) throws DataModelException
XMLPushStream
Should precede namespace and attributes event for the element.
putElementStart
in interface XMLPushStream
putElementStart
in class com.qizx.xdm.XMLPushStreamBase
name
- qualified name of the element. The local-part and
namespace-URI properties of the name are used, but the prefix is
ignored: to define a namespace (i.e a prefix/namespace-URI
association), use the XMLPushStream.putNamespace(java.lang.String, java.lang.String)
method.
DataModelException
- reasonspublic void putElementEnd(QName name) throws DataModelException
XMLPushStream
putElementEnd
in interface XMLPushStream
putElementEnd
in class com.qizx.xdm.XMLPushStreamBase
name
- qualified name of the element
DataModelException
- reasonspublic void putText(String text) throws DataModelException
XMLPushStream
A text fragment should appear inside an element. Consecutive text events are coalesced into one. An empty text fragment is discarded.
text
- a fragment of text
DataModelException
- reasonspublic void putComment(String contents) throws DataModelException
XMLPushStream
putComment
in interface XMLPushStream
putComment
in class com.qizx.xdm.XMLPushStreamBase
contents
- contents of a comment.
DataModelException
- reasonspublic void putProcessingInstruction(String target, String contents) throws DataModelException
XMLPushStream
putProcessingInstruction
in interface XMLPushStream
putProcessingInstruction
in class com.qizx.xdm.XMLPushStreamBase
target
- target (name) of the PIcontents
- contents of the PI
DataModelException
- reasonspublic void reset()
com.qizx.xdm.XMLPushStreamBase
Should always be called before using the object again.
reset
in interface XMLPushStream
reset
in class com.qizx.xdm.XMLPushStreamBase
|
© 2010 Axyana Software | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |