01: package net.sf.saxon.om;
02:
03: import net.sf.saxon.event.Stripper;
04:
05: /**
06: * The AllElementStripper refines the Stripper class to do stripping of
07: * all whitespace nodes in a document
08: * @author Michael H. Kay
09: */
10:
11: public class AllElementStripper extends Stripper {
12:
13: private static AllElementStripper theInstance = new AllElementStripper();
14:
15: public static AllElementStripper getInstance() {
16: return theInstance;
17: }
18:
19: public AllElementStripper() {
20: }
21:
22: public Stripper getAnother() {
23: return theInstance;
24: }
25:
26: /**
27: * Decide whether an element is in the set of white-space preserving element types
28: * @param nameCode identifies the element being tested
29: * @return STRIP_DEFAULT: strip spaces unless xml:space tells you not to.
30: */
31:
32: public byte isSpacePreserving(int nameCode) {
33: return STRIP_DEFAULT;
34: }
35:
36: /**
37: * Decide whether an element is in the set of white-space preserving element types.
38: * This version of the method is useful in cases where getting the namecode of the
39: * element is potentially expensive, e.g. with DOM nodes.
40: * @param element Identifies the element whose whitespace is possibly to
41: * be preserved
42: */
43:
44: public byte isSpacePreserving(NodeInfo element) {
45: return STRIP_DEFAULT;
46: }
47:
48: } // end of class AllElementStripper
49:
50: //
51: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
52: // you may not use this file except in compliance with the License. You may obtain a copy of the
53: // License at http://www.mozilla.org/MPL/
54: //
55: // Software distributed under the License is distributed on an "AS IS" basis,
56: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
57: // See the License for the specific language governing rights and limitations under the License.
58: //
59: // The Original Code is: all this file.
60: //
61: // The Initial Developer of the Original Code is Michael H. Kay
62: //
63: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
64: //
65: // Contributor(s): none.
66: //
|