net.sf.saxon.event
Class AllElementStripper

java.lang.Object
  extended by net.sf.saxon.event.SequenceReceiver
      extended by net.sf.saxon.event.ProxyReceiver
          extended by net.sf.saxon.event.Stripper
              extended by net.sf.saxon.event.AllElementStripper
All Implemented Interfaces:
Result, Receiver

public class AllElementStripper
extends Stripper

The AllElementStripper refines the Stripper class to do stripping of all whitespace nodes in a document

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
 
Fields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING
 
Constructor Summary
AllElementStripper()
          Constructor: create an instance of the class.
 
Method Summary
 Stripper getAnother()
          Create a copy of this Stripper.
static AllElementStripper getInstance()
          Get a singular instance of the class.
 byte isSpacePreserving(int fingerprint)
          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, open, startElement, usesTypeAnnotations
 
Methods inherited from class net.sf.saxon.event.ProxyReceiver
append, close, comment, endDocument, getConfiguration, getDocumentLocator, getNamePool, getUnderlyingReceiver, namespace, processingInstruction, setPipelineConfiguration, setSystemId, setUnderlyingReceiver, setUnparsedEntity, startContent, startDocument
 
Methods inherited from class net.sf.saxon.event.SequenceReceiver
append, getPipelineConfiguration, getSystemId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AllElementStripper

public AllElementStripper()
Constructor: create an instance of the class. This instance can be used as a filter in a pipeline, and can be freely modified by the caller before use.

Method Detail

getInstance

public static AllElementStripper getInstance()
Get a singular instance of the class. Note that this class is NOT a singleton and is NOT immutable. This method should only be used (a) if the filtering behaviour of the class is not being used, or (b) if the getAnother() method is used to clone the class before use as a filter.

Returns:
a singular instance of the class, which the caller must not modify.

getAnother

public Stripper getAnother()
Create a copy of this Stripper. The result can be freely modified by the caller before use.

Specified by:
getAnother in class Stripper
Returns:
a copy of this Stripper. The new copy shares the same PipelineConfiguration as the original, but the underlying receiver (that is, the destination for post-stripping events) is left uninitialized.

isSpacePreserving

public byte isSpacePreserving(int fingerprint)
Decide whether an element is in the set of white-space preserving element types

Specified by:
isSpacePreserving in class Stripper
Parameters:
fingerprint - identifies the element being tested
Returns:
STRIP_DEFAULT: strip spaces unless xml:space tells you not to.


Copyright (c) 2004-2010 Saxonica Limited. All rights reserved.