1. /*
  2. * Copyright 1999-2004 The Apache Software Foundation.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  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 com.sun.org.apache.xpath.internal;
  20. import javax.xml.transform.TransformerException;
  21. import org.w3c.dom.Element;
  22. /**
  23. * A class that implements this interface can tell if a given element should
  24. * strip whitespace nodes from it's children.
  25. */
  26. public interface WhitespaceStrippingElementMatcher
  27. {
  28. /**
  29. * Get information about whether or not an element should strip whitespace.
  30. * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a>
  31. *
  32. * @param support The XPath runtime state.
  33. * @param targetElement Element to check
  34. *
  35. * @return true if the whitespace should be stripped.
  36. *
  37. * @throws TransformerException
  38. */
  39. public boolean shouldStripWhiteSpace(
  40. XPathContext support, Element targetElement) throws TransformerException;
  41. /**
  42. * Get information about whether or not whitespace can be stripped.
  43. * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a>
  44. *
  45. * @return true if the whitespace can be stripped.
  46. */
  47. public boolean canStripWhiteSpace();
  48. }