Interface DOMDocument

  • All Known Implementing Classes:
    DefaultDOMDocument

    public interface DOMDocument
    This interface models a document to be processed by the Validator.
    Author:
    Michele Mostarda (mostarda@fbk.eu), Davide Palmisano (palmisano@fbk.eu)
    • Method Detail

      • getDocumentIRI

        URI getDocumentIRI()
        Returns:
        the original document IRI.
      • getOriginalDocument

        Document getOriginalDocument()
        Returns the original document.
        Returns:
        the original document.
      • getNodes

        List<Node> getNodes​(String xPath)
        Returns the list of nodes addressed by the given XPath.
        Parameters:
        xPath - a valid XPath
        Returns:
        a not null list of nodes.
      • getNode

        Node getNode​(String xPath)
        Returns the node addressed by the given XPath, if more then one an exception will be raised.
        Parameters:
        xPath - a valid XPath.
        Returns:
        a node or null if nothing found.
      • addAttribute

        void addAttribute​(String xPath,
                          String attrName,
                          String attrValue)
        Adds an attribute to a node addressed by the given XPath.
        Parameters:
        xPath - the XPath pointing the node.
        attrName - the name of the attribute.
        attrValue - the value of the attribute.
      • getNodesWithAttribute

        List<Node> getNodesWithAttribute​(String attrName)
        Returns all the nodes declaring an attribute with the specified name.
        Parameters:
        attrName - name of attribute to use for filtering.
        Returns:
        a list of nodes. null if no matches found.