Package net.sf.saxon.s9api.push
Interface Document
- All Superinterfaces:
Container
A
Container representing a document node.
If the document is constrained to be well-formed then the permitted sequence of events is
(COMMENT | PI)* ELEMENT (COMMENT | PI)* CLOSE.
If the document is NOT constrained to be well-formed then the permitted sequence of events is
(COMMENT | PI | TEXT | ELEMENT)* CLOSE.
-
Method Summary
Modifier and TypeMethodDescriptioncomment(CharSequence value) Add a comment node to the current element or document node.processingInstruction(String name, CharSequence value) Add a processing instruction node to the current element or document node.text(CharSequence value) Add text content to the current element node (or, in the case of a non-well-formed document, as a child of the document node).Methods inherited from interface net.sf.saxon.s9api.push.Container
close, element, element, setDefaultNamespace
-
Method Details
-
text
Description copied from interface:ContainerAdd text content to the current element node (or, in the case of a non-well-formed document, as a child of the document node).Multiple consecutive calls on
text()generate a single text node with concatenated content: that is,text("one).text("two")is equivalent totext("onetwo").- Specified by:
textin interfaceContainer- Parameters:
value- the content of the text node. Supplying a zero-length string or null is permitted, but has no effect.- Returns:
- the Container to which the method is applied. This is to allow chained method calls, of the form
tag.element("a").text("content").close() - Throws:
SaxonApiException- if the specified constraints are violated, or if the implementation detects any problems
-
comment
Description copied from interface:ContainerAdd a comment node to the current element or document node.The method call is allowed in states
START_TAG,CONTENT, andNON_TEXT_CONTENT, and it sets the state toCONTENT.- Specified by:
commentin interfaceContainer- Parameters:
value- the content of the comment node. The value should not contain the string "--"; it is implementation-defined whether this causes an exception, or whether some recovery action is taken such as replacing the string by "- -". If the value is null, no comment node is written.- Returns:
- the Container to which the method is applied. This is to allow chained method calls, of the form
tag.element("a").comment("optional").close() - Throws:
SaxonApiException- if the specified constraints are violated, or if the implementation detects any problems
-
processingInstruction
Description copied from interface:ContainerAdd a processing instruction node to the current element or document node.The method call is allowed in states
START_TAG,CONTENT, andNON_TEXT_CONTENT, and it sets the state toCONTENT.- Specified by:
processingInstructionin interfaceContainer- Parameters:
name- the name ("target") of the processing instruction. The level of validation applied to the supplied name is implementation-defined. Must not be null.value- the content ("data") of the processing instruction node. The value should not contain the string"?>"; it is implementation-defined whether this causes an exception, or whether some recovery action is taken such as replacing the string by"? >". If the value is null, no processing instruction node is written.- Returns:
- the Container to which the method is applied. This is to allow chained method calls, of the form
tag.element("a").processing-instruction("target", "data").close() - Throws:
SaxonApiException- if the specified constraints are violated, or if the implementation detects any problems
-