Package net.sf.saxon.dom
Class DOMWriter
java.lang.Object
net.sf.saxon.event.Builder
net.sf.saxon.dom.DOMWriter
- Direct Known Subclasses:
- DominoTreeModel.DominoBuilder
DOMWriter is a Receiver that attaches the result tree to a specified Node in the DOM Document
- 
Field SummaryFields inherited from class net.sf.saxon.event.BuilderAXIOM_TREE, baseURI, config, currentRoot, DOMINO_TREE, durability, JDOM_TREE, JDOM2_TREE, lineNumbering, LINKED_TREE, MUTABLE_LINKED_TREE, namePool, opened, started, timing, TINY_TREE, TINY_TREE_CONDENSED, uniformBaseURI, UNSPECIFIED_TREE_MODEL, useEventLocationFields inherited from interface javax.xml.transform.ResultPI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidcharacters(UnicodeString chars, Location locationId, int properties) Character data.voidclose()End of the document.voidcomment(UnicodeString chars, Location locationId, int properties) Handle a comment.voidNotify the end of a document nodevoidEnd of an element.Get the current root node.protected DocumentGet the constructed DOM Document nodeGet the pipeline configuration used for this documentGet the system identifier that was set with setSystemId.voidopen()Start of the document.voidprocessingInstruction(String target, UnicodeString data, Location locationId, int properties) Handle a processing instruction.voidsetNextSibling(Node nextSibling) Set next siblingvoidSet the attachment point for the new subtreevoidSet the pipelineConfigurationvoidsetSystemId(String systemId) Set the System ID of the destination treevoidsetUnparsedEntity(String name, String systemID, String publicID) Notify an unparsed entity URI.voidstartDocument(int properties) Start of a document node.voidstartElement(NodeName elemName, SchemaType type, AttributeMap attributes, NamespaceMap namespaces, Location location, int properties) Start of an element.booleanAsk whether this Receiver (or the downstream pipeline) makes any use of the type annotations supplied on element and attribute eventsMethods inherited from class net.sf.saxon.event.BuildergetBaseURI, getBuilderMonitor, getConfiguration, getDurability, isTiming, isUseEventLocation, reset, setBaseURI, setDurability, setLineNumbering, setTiming, setUseEventLocationMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.sf.saxon.event.Receiverappend, append, handlesAppend
- 
Constructor Details- 
DOMWriterpublic DOMWriter()
 
- 
- 
Method Details- 
setPipelineConfigurationSet the pipelineConfiguration- Specified by:
- setPipelineConfigurationin interface- Receiver
- Overrides:
- setPipelineConfigurationin class- Builder
- Parameters:
- pipe- the pipeline configuration
 
- 
getPipelineConfigurationGet the pipeline configuration used for this document- Specified by:
- getPipelineConfigurationin interface- Receiver
- Overrides:
- getPipelineConfigurationin class- Builder
- Returns:
- the pipeline configuration
 
- 
setSystemIdSet the System ID of the destination tree- Specified by:
- setSystemIdin interface- Result
- Overrides:
- setSystemIdin class- Builder
- Parameters:
- systemId- the SystemId, that is, the document-uri.
 
- 
setUnparsedEntityNotify an unparsed entity URI.- Parameters:
- name- The name of the unparsed entity
- systemID- The system identifier of the unparsed entity
- publicID- The public identifier of the unparsed entity
- Throws:
- XPathException- if an error occurs
 
- 
getSystemIdGet the system identifier that was set with setSystemId.- Specified by:
- getSystemIdin interface- Result
- Overrides:
- getSystemIdin class- Builder
- Returns:
- The system identifier that was set with setSystemId, or null if setSystemId was not called.
 
- 
openpublic void open()Start of the document.
- 
closepublic void close()End of the document.
- 
startDocumentStart of a document node.- Parameters:
- properties- bit-significant integer indicating properties of the document node. The definitions of the bits are in class- ReceiverOption
- Throws:
- XPathException- if an error occurs
 
- 
endDocumentNotify the end of a document node- Throws:
- XPathException- if an error occurs
 
- 
startElementpublic void startElement(NodeName elemName, SchemaType type, AttributeMap attributes, NamespaceMap namespaces, Location location, int properties) throws XPathException Start of an element.- Parameters:
- elemName- the name of the element.
- type- the type annotation of the element.
- attributes- the attributes of this element
- namespaces- the in-scope namespaces of this element: generally this is all the in-scope namespaces, without relying on inheriting namespaces from parent elements
- location- an object providing information about the module, line, and column where the node originated
- properties- bit-significant properties of the element node. If there are no relevant properties, zero is supplied. The definitions of the bits are in class- ReceiverOption
- Throws:
- XPathException- if an error occurs
 
- 
endElementEnd of an element.- Throws:
- XPathException- if an error occurs
 
- 
characterspublic void characters(UnicodeString chars, Location locationId, int properties) throws XPathException Character data.- Parameters:
- chars- The characters
- locationId- provides information such as line number and system ID.
- properties- Bit significant value. The following bits are defined:- DISABLE_ESCAPING
- Disable escaping for this text node
- USE_CDATA
- Output as a CDATA section
 
- Throws:
- XPathException- if an error occurs
 
- 
processingInstructionpublic void processingInstruction(String target, UnicodeString data, Location locationId, int properties) throws XPathException Handle a processing instruction.- Parameters:
- target- The PI name. This must be a legal name (it will not be checked).
- data- The data portion of the processing instruction
- locationId- provides information such as line number and system ID.
- properties- Additional information about the PI.
- Throws:
- XPathException- if an error occurs
 
- 
commentHandle a comment.- Parameters:
- chars- The content of the comment
- locationId- provides information such as line number and system ID.
- properties- Additional information about the comment.
- Throws:
- XPathException- if an error occurs
 
- 
usesTypeAnnotationspublic boolean usesTypeAnnotations()Ask whether this Receiver (or the downstream pipeline) makes any use of the type annotations supplied on element and attribute events- Specified by:
- usesTypeAnnotationsin interface- Receiver
- Overrides:
- usesTypeAnnotationsin class- Builder
- Returns:
- true if the Receiver makes any use of this information. If false, the caller may supply untyped nodes instead of supplying the type annotation
 
- 
setNodeSet the attachment point for the new subtree- Parameters:
- node- the node to which the new subtree will be attached
 
- 
setNextSiblingSet next sibling- Parameters:
- nextSibling- the node, which must be a child of the attachment point, before which the new subtree will be created. If this is null the new subtree will be added after any existing children of the attachment point.
 
- 
getCurrentRootGet the current root node. This will normally be a document node, but if the root of the tree is an element node, it can be an element.- Overrides:
- getCurrentRootin class- Builder
- Returns:
- the root of the tree that is currently being built, or that has been most recently built using this builder
 
- 
getDOMDocumentNodeGet the constructed DOM Document node- Returns:
- the DOM Document node
 
 
-