Class DomAttr

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, org.w3c.dom.Attr, org.w3c.dom.Node

    public class DomAttr
    extends DomNamespaceNode
    implements org.w3c.dom.Attr
    An attribute of an element. Attributes are stored in HtmlElement, but the XPath engine expects attributes to be in a DomNode.
    See Also:
    Serialized Form
    • Constructor Detail

      • DomAttr

        public DomAttr​(SgmlPage page,
                       java.lang.String namespaceURI,
                       java.lang.String qualifiedName,
                       java.lang.String value,
                       boolean specified)
        Instantiate a new attribute.
        Parameters:
        page - the page that the attribute belongs to
        namespaceURI - the namespace that defines the attribute name (may be null)
        qualifiedName - the name of the attribute
        value - the value of the attribute
        specified - true if this attribute was explicitly given a value in the source document, or if the application changed the value of the attribute
    • Method Detail

      • getNodeType

        public short getNodeType()
        Specified by:
        getNodeType in interface org.w3c.dom.Node
      • getNodeName

        public java.lang.String getNodeName()
        Specified by:
        getNodeName in interface org.w3c.dom.Node
      • getNodeValue

        public java.lang.String getNodeValue()
        Specified by:
        getNodeValue in interface org.w3c.dom.Node
        Overrides:
        getNodeValue in class DomNode
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface org.w3c.dom.Attr
      • getValue

        public java.lang.String getValue()
        Specified by:
        getValue in interface org.w3c.dom.Attr
      • setNodeValue

        public void setNodeValue​(java.lang.String value)
        Specified by:
        setNodeValue in interface org.w3c.dom.Node
      • setValue

        public void setValue​(java.lang.String value)
        Specified by:
        setValue in interface org.w3c.dom.Attr
      • getOwnerElement

        public DomElement getOwnerElement()
        Specified by:
        getOwnerElement in interface org.w3c.dom.Attr
      • getSpecified

        public boolean getSpecified()
        Specified by:
        getSpecified in interface org.w3c.dom.Attr
      • getSchemaTypeInfo

        public org.w3c.dom.TypeInfo getSchemaTypeInfo()
        Not yet implemented.
        Specified by:
        getSchemaTypeInfo in interface org.w3c.dom.Attr
      • isId

        public boolean isId()
        Specified by:
        isId in interface org.w3c.dom.Attr
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getCanonicalXPath

        public java.lang.String getCanonicalXPath()

        Returns the canonical XPath expression which identifies this node, for instance "/html/body/table[3]/tbody/tr[5]/td[2]/span/a[3]".

        WARNING: This sort of automated XPath expression is often quite bad at identifying a node, as it is highly sensitive to changes in the DOM tree.

        Overrides:
        getCanonicalXPath in class DomNode
        Returns:
        the canonical XPath expression which identifies this node
        See Also:
        DomNode.getByXPath(String)
      • getTextContent

        public java.lang.String getTextContent()
        Specified by:
        getTextContent in interface org.w3c.dom.Node
        Overrides:
        getTextContent in class DomNode
      • setTextContent

        public void setTextContent​(java.lang.String textContent)
        Specified by:
        setTextContent in interface org.w3c.dom.Node
        Overrides:
        setTextContent in class DomNode