Package org.dom4j.io

Interface ElementModifier


  • public interface ElementModifier
    ElementModifier defines a modifier of Elementobjects.
    It can be used in the event based SAXModifier, in order to modify elements on the fly, rather than waiting until the complete document is parsed.
    • Method Detail

      • modifyElement

        Element modifyElement(Element element)
                       throws java.lang.Exception
        Called by an event based processor when an elements closing tag is encountered. This method must return the modified version of the provided Elementor null if it has to be removed from the document.
        The incoming Elementis disconnected from the DOM4J tree. This means that navigation to the elements parent Element and Documentare not available. Only the element itself can be modified!
        Parameters:
        element - Elementto be parsed
        Returns:
        the modified Element
        Throws:
        java.lang.Exception - of any kind