Class AllElementStripper

  • All Implemented Interfaces:
    javax.xml.transform.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
    • Constructor Detail

      • AllElementStripper

        public AllElementStripper()
    • Method Detail

      • 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