KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > saxon > om > AllElementStripper


1 package net.sf.saxon.om;
2 import net.sf.saxon.event.Stripper;
3
4 /**
5   * The AllElementStripper refines the Stripper class to do stripping of
6   * all whitespace nodes in a document
7   * @author Michael H. Kay
8   */

9
10 public class AllElementStripper extends Stripper {
11
12     private static AllElementStripper theInstance = new AllElementStripper();
13
14     public static AllElementStripper getInstance() {
15         return theInstance;
16     }
17
18     public AllElementStripper() {}
19
20     public Stripper getAnother() {
21         return theInstance;
22     }
23
24     /**
25     * Decide whether an element is in the set of white-space preserving element types
26     * @param nameCode identifies the element being tested
27     * @return STRIP_DEFAULT: strip spaces unless xml:space tells you not to.
28     */

29
30     public byte isSpacePreserving(int nameCode) {
31         return STRIP_DEFAULT;
32     }
33
34     /**
35     * Decide whether an element is in the set of white-space preserving element types.
36      * This version of the method is useful in cases where getting the namecode of the
37      * element is potentially expensive, e.g. with DOM nodes.
38     * @param element Identifies the element whose whitespace is possibly to
39      * be preserved
40     */

41
42     public byte isSpacePreserving(NodeInfo element) {
43         return STRIP_DEFAULT;
44     }
45
46 } // end of class AllElementStripper
47

48 //
49
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
50
// you may not use this file except in compliance with the License. You may obtain a copy of the
51
// License at http://www.mozilla.org/MPL/
52
//
53
// Software distributed under the License is distributed on an "AS IS" basis,
54
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
55
// See the License for the specific language governing rights and limitations under the License.
56
//
57
// The Original Code is: all this file.
58
//
59
// The Initial Developer of the Original Code is Michael H. Kay
60
//
61
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
62
//
63
// Contributor(s): none.
64
//
65
Popular Tags