|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.event.SequenceReceiver net.sf.saxon.event.ProxyReceiver net.sf.saxon.event.Stripper
public class Stripper
The Stripper class performs whitespace stripping according to the rules of the xsl:strip-space and xsl:preserve-space instructions. It maintains details of which elements need to be stripped. The code is written to act as a SAX-like filter to do the stripping.
Field Summary | |
---|---|
static byte |
ALWAYS_PRESERVE
|
static byte |
ALWAYS_STRIP
|
static byte |
CANNOT_STRIP
|
static RuleTarget |
PRESERVE
|
static byte |
PRESERVE_PARENT
|
static RuleTarget |
STRIP
|
static byte |
STRIP_DEFAULT
|
Fields inherited from class net.sf.saxon.event.ProxyReceiver |
---|
nextReceiver |
Fields inherited from class net.sf.saxon.event.SequenceReceiver |
---|
pipelineConfiguration, previousAtomic, systemId |
Fields inherited from interface javax.xml.transform.Result |
---|
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING |
Constructor Summary | |
---|---|
protected |
Stripper()
Default constructor for use in subclasses |
|
Stripper(Mode stripperRules)
create a Stripper and initialise variables |
Method Summary | |
---|---|
void |
attribute(int nameCode,
int typeCode,
CharSequence value,
int locationId,
int properties)
Notify an attribute. |
void |
characters(CharSequence chars,
int locationId,
int properties)
Handle a text node |
void |
endElement()
Handle an end-of-element event |
Stripper |
getAnother()
Get a clean copy of this stripper |
boolean |
getStripAll()
Determine if all whitespace is to be stripped (in this case, no further testing is needed) |
byte |
isSpacePreserving(int nameCode)
Decide whether an element is in the set of white-space preserving element types |
byte |
isSpacePreserving(NodeInfo element)
Decide whether an element is in the set of white-space preserving element types. |
void |
open()
Callback interface for SAX: not for application use |
void |
setPipelineConfiguration(PipelineConfiguration pipe)
Set the pipeline configuration |
void |
setStripAll()
Specify that all whitespace nodes are to be stripped |
void |
setXPathContext(XPathContext context)
Set the XPath context |
void |
startElement(int nameCode,
int typeCode,
int locationId,
int properties)
Notify the start of an element |
boolean |
usesTypeAnnotations()
Ask whether this Receiver (or the downstream pipeline) makes any use of the type annotations supplied on element and attribute events |
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final RuleTarget STRIP
public static final RuleTarget PRESERVE
public static final byte ALWAYS_PRESERVE
public static final byte ALWAYS_STRIP
public static final byte STRIP_DEFAULT
public static final byte PRESERVE_PARENT
public static final byte CANNOT_STRIP
Constructor Detail |
---|
protected Stripper()
public Stripper(Mode stripperRules)
stripperRules
- defines which elements have whitespace stripped. If
null, all whitespace is preserved.Method Detail |
---|
public void setXPathContext(XPathContext context)
public Stripper getAnother()
public void setStripAll()
public boolean getStripAll()
public void setPipelineConfiguration(PipelineConfiguration pipe)
Receiver
setPipelineConfiguration
in interface Receiver
setPipelineConfiguration
in class ProxyReceiver
pipe
- the pipeline configurationpublic byte isSpacePreserving(int nameCode) throws XPathException
nameCode
- Identifies the name of the element whose whitespace is to
be preserved
XPathException
public byte isSpacePreserving(NodeInfo element) throws XPathException
element
- Identifies the element whose whitespace is possibly to
be preserved
XPathException
public void open() throws XPathException
open
in interface Receiver
open
in class ProxyReceiver
XPathException
public void startElement(int nameCode, int typeCode, int locationId, int properties) throws XPathException
ProxyReceiver
startElement
in interface Receiver
startElement
in class ProxyReceiver
nameCode
- integer code identifying the name of the element within the name pool.typeCode
- integer code identifying the element's type within the name pool.locationId
- an integer which can be interpreted using a LocationProvider
to return
information such as line number and system ID. If no location information is available,
the value zero is supplied.properties
- properties of the element node
XPathException
public void attribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties) throws XPathException
ProxyReceiver
attribute
in interface Receiver
attribute
in class ProxyReceiver
nameCode
- The name of the attribute, as held in the name pooltypeCode
- The type of the attribute, as held in the name poolvalue
- the string value of the attributelocationId
- an integer which can be interpreted using a LocationProvider
to return
information such as line number and system ID. If no location information is available,
the value zero is supplied.properties
- Bit significant value. The following bits are defined:
XPathException
public void endElement() throws XPathException
endElement
in interface Receiver
endElement
in class ProxyReceiver
XPathException
public void characters(CharSequence chars, int locationId, int properties) throws XPathException
characters
in interface Receiver
characters
in class ProxyReceiver
chars
- The characterslocationId
- an integer which can be interpreted using a LocationProvider
to return information such as line number and system ID. If no location information is available,
the value zero is supplied.properties
- Bit significant value. The following bits are defined:
XPathException
public boolean usesTypeAnnotations()
usesTypeAnnotations
in interface Receiver
usesTypeAnnotations
in class ProxyReceiver
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |