Debian Codegraph @

net/sf/saxon/om/SpaceStrippingRule.java

raw symbols SCIP
1 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2018 Saxonica Limited.
3 // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4 // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 // This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
6 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
7
8 package net.sf.saxon.om;
9
10
11 import net.sf.saxon.event.ProxyReceiver;
12 import net.sf.saxon.event.Receiver;
13 import net.sf.saxon.trace.ExpressionPresenter;
14 import net.sf.saxon.trans.XPathException;
15 import net.sf.saxon.type.SchemaType;
16
17 /**
18 * Interface for deciding whether a particular element is to have whitespace text nodes stripped
19 */
20
21 public interface SpaceStrippingRule {
22
23 /**
24 * Decide whether an element is in the set of white-space preserving element types
25 *
26 * @param nodeName Identifies the name of the element whose whitespace is (or is not) to
27 * be preserved
28 * @param schemaType The type annotation of the element whose whitespace is (or is not) to
29 * be preserved
30 * @return {@link net.sf.saxon.event.Stripper#ALWAYS_PRESERVE} if the element is in the set of white-space preserving
31 * element types, {@link net.sf.saxon.event.Stripper#ALWAYS_STRIP} if the element is to be stripped regardless of the
32 * xml:space setting, and {@link net.sf.saxon.event.Stripper#STRIP_DEFAULT} otherwise
33 * @throws net.sf.saxon.trans.XPathException
34 * if the rules are ambiguous and ambiguities are to be
35 * reported as errors
36 */
37
38 int isSpacePreserving(NodeName nodeName, SchemaType schemaType) throws XPathException;
39
40 /**
41 * Make a filter to implement these space-stripping rules, or null if no filtering
42 * is necessary
43 * @param next the Receiver that is to receiver the filtered event stream
44 * @return a filter in the form of a ProxyReceiver, or null
45 */
46
47 ProxyReceiver makeStripper(Receiver next);
48
49 /**
50 * Export this rule as part of an exported stylesheet
51 * @param presenter the output handler
52 */
53
54 void export(ExpressionPresenter presenter) throws XPathException;
55
56 }
57