Package net.sf.saxon.style
Class StylesheetStripper
- java.lang.Object
-
- net.sf.saxon.event.SequenceReceiver
-
- net.sf.saxon.event.ProxyReceiver
-
- net.sf.saxon.event.Stripper
-
- net.sf.saxon.style.StylesheetStripper
-
- All Implemented Interfaces:
javax.xml.transform.Result
,Receiver
public class StylesheetStripper extends Stripper
The StylesheetStripper refines the Stripper class to do stripping of whitespace nodes on a stylesheet. This is handled specially (a) because it is done at compile time, so there is no Controller available, and (b) because the rules are very simple- Author:
- Michael H. Kay
-
-
Field Summary
-
Fields inherited from class net.sf.saxon.event.Stripper
ALWAYS_PRESERVE, ALWAYS_STRIP, CANNOT_STRIP, PRESERVE_PARENT, STRIP_DEFAULT
-
Fields inherited from class net.sf.saxon.event.ProxyReceiver
nextReceiver
-
Fields inherited from class net.sf.saxon.event.SequenceReceiver
pipelineConfiguration, previousAtomic, systemId
-
-
Constructor Summary
Constructors Constructor Description StylesheetStripper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stripper
getAnother()
Get a clean copy of this stripperbyte
isSpacePreserving(int nameCode)
Decide whether an element is in the set of white-space preserving element typesbyte
isSpacePreserving(NodeInfo element)
Decide whether an element is in the set of white-space preserving element types.-
Methods inherited from class net.sf.saxon.event.Stripper
attribute, characters, endElement, getStripAll, open, setPipelineConfiguration, setStripAll, setXPathContext, startElement
-
Methods inherited from class net.sf.saxon.event.ProxyReceiver
append, close, comment, endDocument, getConfiguration, getDocumentLocator, getNamePool, getUnderlyingReceiver, namespace, processingInstruction, setSystemId, setUnderlyingReceiver, setUnparsedEntity, startContent, startDocument
-
Methods inherited from class net.sf.saxon.event.SequenceReceiver
getPipelineConfiguration, getSystemId
-
-
-
-
Method Detail
-
getAnother
public Stripper getAnother()
Description copied from class:Stripper
Get a clean copy of this stripper- Overrides:
getAnother
in classStripper
-
isSpacePreserving
public byte isSpacePreserving(int nameCode)
Decide whether an element is in the set of white-space preserving element types- Overrides:
isSpacePreserving
in classStripper
- Parameters:
nameCode
- identifies the element being tested- Returns:
- ALWAYS_PRESERVE if the element is in the set of white-space preserving element types, ALWAYS_STRIP if the element is to be stripped regardless of the xml:space setting, and STRIP_DEFAULT otherwise
-
isSpacePreserving
public byte isSpacePreserving(NodeInfo element) throws XPathException
Decide whether an element is in the set of white-space preserving element types. This version of the method is useful in cases where getting the namecode of the element is potentially expensive, e.g. with DOM nodes.- Overrides:
isSpacePreserving
in classStripper
- Parameters:
element
- Identifies the element whose whitespace is possibly to be preserved- Returns:
- true if the element is in the set of white-space preserving element types
- Throws:
XPathException
-
-