GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
HTML::DOM::Attr(3) User Contributed Perl Documentation HTML::DOM::Attr(3)

HTML::DOM::Attr - A Perl class for representing attribute nodes in an HTML DOM tree

Version 0.058

  use HTML::DOM;
  $doc = HTML::DOM->new;
  $attr = $doc->createAttribute('href');
  $attr->nodeValue('http://localhost/');
  $elem = $doc->createElement('a');
  $elem->setAttributeNode($attr);
  
  $attr->nodeName;  # href
  $attr->nodeValue; # http://...
  
  $attr->firstChild; # a text node
  
  $attr->ownerElement; # returns $elem

This class is used for attribute nodes in an HTML::DOM tree. It implements the Node and Attr DOM interfaces and inherits from HTML::DOM::EventTarget. An attribute node stringifies to its value. As a boolean it is true, even if its value is false.

The following DOM attributes are supported:
nodeName
name
These both return the name of the attribute.
nodeType
Returns the constant "HTML::DOM::Node::ATTRIBUTE_NODE".
nodeValue
value
These both return the attribute's value, setting it if there is an argument.
specified
Returns true if the attribute was specified explicitly in the source code or was explicitly added to the tree.
parentNode
previousSibling
nextSibling
attributes
namespaceURI
prefix
localName
All of these simply return an empty list.
childNodes
In scalar context, this returns a node list object with one text node in it. In list context it returns a list containing just that text node.
firstChild
lastChild
These both return the attribute's text node.
ownerDocument
Returns the document to which the attribute node belongs.
ownerElement
Returns the element to which the attribute belongs.

insertBefore
removeChild
appendChild
These three just throw exceptions.
replaceChild
If the first argument is a text node and the second is the attribute node's own text node, then the latter is replaced with the former. This throws an exception otherwise.
hasChildNodes
Returns true.
cloneNode
Returns a clone of the attribute.
normalize
Does nothing.
hasAttributes
Returns false.
isSupported
Does the same thing as HTML::DOM::Implementation's hasFeature method.

HTML::DOM

HTML::DOM::Node

HTML::DOM::Element

HTML::DOM::EventTarget

2018-02-02 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.