net.sf.saxon.om
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.om.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, PRESERVE_PARENT, STRIP, 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()
           
 
Method Summary
 Stripper getAnother()
          Get a clean copy of this stripper
static AllElementStripper getInstance()
           
 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.
 
Methods inherited from class net.sf.saxon.event.Stripper
attribute, characters, endElement, getStripAll, open, setPipelineConfiguration, setStripAll, setXPathContext, startElement, usesTypeAnnotations
 
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
 

Constructor Detail

AllElementStripper

public AllElementStripper()
Method Detail

getInstance

public static AllElementStripper getInstance()

getAnother

public Stripper getAnother()
Description copied from class: Stripper
Get a clean copy of this stripper

Overrides:
getAnother in class Stripper

isSpacePreserving

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

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

isSpacePreserving

public byte isSpacePreserving(NodeInfo element)
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 class Stripper
Parameters:
element - Identifies the element whose whitespace is possibly to be preserved
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


Copyright (c) Saxonica Limited. All rights reserved.