01: /*
02: * Copyright 1999-2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: /*
17: * $Id: WhitespaceStrippingElementMatcher.java,v 1.4 2004/02/17 04:30:02 minchau Exp $
18: */
19: package org.apache.xpath;
20:
21: import javax.xml.transform.TransformerException;
22:
23: import org.w3c.dom.Element;
24:
25: /**
26: * A class that implements this interface can tell if a given element should
27: * strip whitespace nodes from it's children.
28: */
29: public interface WhitespaceStrippingElementMatcher {
30: /**
31: * Get information about whether or not an element should strip whitespace.
32: * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a>
33: *
34: * @param support The XPath runtime state.
35: * @param targetElement Element to check
36: *
37: * @return true if the whitespace should be stripped.
38: *
39: * @throws TransformerException
40: */
41: public boolean shouldStripWhiteSpace(XPathContext support,
42: Element targetElement) throws TransformerException;
43:
44: /**
45: * Get information about whether or not whitespace can be stripped.
46: * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a>
47: *
48: * @return true if the whitespace can be stripped.
49: */
50: public boolean canStripWhiteSpace();
51: }
|