1. package org.apache.xpath;
  2. import org.w3c.dom.Element;
  3. import javax.xml.transform.TransformerException;
  4. /**
  5. * A class that implements this interface can tell if a given element should
  6. * strip whitespace nodes from it's children.
  7. */
  8. public interface WhitespaceStrippingElementMatcher
  9. {
  10. /**
  11. * Get information about whether or not an element should strip whitespace.
  12. * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a>
  13. *
  14. * @param support The XPath runtime state.
  15. * @param targetElement Element to check
  16. *
  17. * @return true if the whitespace should be stripped.
  18. *
  19. * @throws TransformerException
  20. */
  21. public boolean shouldStripWhiteSpace(
  22. XPathContext support, Element targetElement) throws TransformerException;
  23. /**
  24. * Get information about whether or not whitespace can be stripped.
  25. * @see <a href="http://www.w3.org/TR/xslt#strip">strip in XSLT Specification</a>
  26. *
  27. * @return true if the whitespace can be stripped.
  28. */
  29. public boolean canStripWhiteSpace();
  30. }