public class SpaceStrippedDocument extends GenericTreeInfo
Constructor and Description |
---|
SpaceStrippedDocument(TreeInfo doc,
SpaceStrippingRule strippingRule)
Create a space-stripped view of a document
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsAssertions()
Ask whether the stripped document contain any nodes annotated with types that carry assertions
|
boolean |
containsPreserveSpace()
Ask whether the stripped document contains any xml:space="preserve" attributes.
|
SpaceStrippingRule |
getStrippingRule()
Get the document's strippingRule
|
java.lang.String[] |
getUnparsedEntity(java.lang.String name)
Get the unparsed entity with a given name
|
java.util.Iterator<java.lang.String> |
getUnparsedEntityNames()
Get the list of unparsed entities defined in this document
|
static boolean |
isAlreadyStripped(TreeInfo doc,
SpaceStrippingRule strippingRule) |
boolean |
isTyped()
Ask whether the document contains any nodes whose type annotation is anything other than
UNTYPED
|
NodeInfo |
selectID(java.lang.String id,
boolean getParent)
Get the element with a given ID, if any
|
SpaceStrippedNode |
wrap(NodeInfo node)
Create a wrapped node within this document
|
getConfiguration, getDocumentNumber, getPublicId, getRootNode, getSystemId, getUserData, isStreamed, setConfiguration, setDocumentNumber, setRootNode, setSystemId, setUserData
public SpaceStrippedDocument(TreeInfo doc, SpaceStrippingRule strippingRule)
doc
- the underlying documentstrippingRule
- an object that contains the rules defining which whitespace
text nodes are to be absent from the viewpublic static boolean isAlreadyStripped(TreeInfo doc, SpaceStrippingRule strippingRule)
public SpaceStrippedNode wrap(NodeInfo node)
public boolean isTyped()
isTyped
in interface TreeInfo
isTyped
in class GenericTreeInfo
public SpaceStrippingRule getStrippingRule()
public NodeInfo selectID(java.lang.String id, boolean getParent)
selectID
in interface TreeInfo
selectID
in class GenericTreeInfo
id
- the required ID valuegetParent
- true if we want the parent of an element with the ID valuepublic java.util.Iterator<java.lang.String> getUnparsedEntityNames()
getUnparsedEntityNames
in interface TreeInfo
getUnparsedEntityNames
in class GenericTreeInfo
public java.lang.String[] getUnparsedEntity(java.lang.String name)
getUnparsedEntity
in interface TreeInfo
getUnparsedEntity
in class GenericTreeInfo
name
- the name of the entitypublic boolean containsPreserveSpace()
public boolean containsAssertions()
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.