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:

These both return the name of the attribute.
Returns the constant "HTML::DOM::Node::ATTRIBUTE_NODE".
These both return the attribute's value, setting it if there is an argument.
Returns true if the attribute was specified explicitly in the source code or was explicitly added to the tree.
All of these simply return an empty list.
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.
These both return the attribute's text node.
Returns the document to which the attribute node belongs.
Returns the element to which the attribute belongs.

These three just throw exceptions.
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.
Returns true.
Returns a clone of the attribute.
Does nothing.
Returns false.
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.40.2

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.