NAME

HTML::Object::DOM::Attribute - HTML Object

SYNOPSIS

use HTML::Object::DOM::Attribute;
my $this = HTML::Object::DOM::Attribute->new || die( HTML::Object::DOM::Attribute->error, "\n" );

VERSION

v0.2.0

DESCRIPTION

This module implements a DOM node attribute. It inherits from HTML::Object::Attribute and from HTML::Object::DOM::Node

INHERITANCE

+-----------------------+     +---------------------------+     +-------------------------+     +----------------------------+
| HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Closing |
+-----------------------+     +---------------------------+     +-------------------------+     +----------------------------+
  |                                                                                               ^
  |                                                                                               |
  v                                                                                               |
+-----------------------+                                                                         |
| HTML::Object::Closing | ------------------------------------------------------------------------+
+-----------------------+

PROPERTIES

nodeValue

Returns the attribute value as a scalar object

METHODS

getAttributes

If this attribute has no associated element, this returns an empty list in list context or an empty array reference in scalar context.

Otherwise, this returns an array object of attribute objects for the associated element.

getChildNodes

Returns an empty list in list context, or an empty array reference in scalar context.

getElementById

Returns an empty list in list context, or undef in scalar context.

getFirstChild

Returns an empty list in list context, or undef in scalar context.

getLastChild

Returns an empty list in list context, or undef in scalar context.

getLocalName

Returns the attribute name.

getName

Returns the attribute name.

getNextSibling

Returns the next attribute object for the associated element, or undef if there are no associated element, or if this attribute is the last one of the associated element.

getParentNode

Returns the associated element, if any.

getPreviousSibling

Returns the previous attribute object for the associated element, or undef if there are no associated element, or if this attribute is the first one of the associated element.

getRootNode

Returns the root node by calling getRootNode on this attribute parent.

getValue

Returns the attribute value.

isAttributeNode

Returns true.

isCommentNode

Returns false.

isElementNode

Returns false.

isEqualNode

Provided with another attribute object, and this returns true if both attribute object have the same value, or false otherwise.

isNamespaceNode

Returns false.

isPINode

Returns false.

isProcessingInstructionNode

Returns false.

isTextNode

Returns false.

is_inside

Provided with a node and this returns true if this attribute associated element is the same, or if the associated element is inside the provided element.

lineage

Returns the value provided by calling lineage on the associated element and adding it to the lineage, or an empty "array object" if there is no associated element.

localName

This is just an alias for "getName"

namespaceURI

Always returns undef

nodeName

Returns the qualified name of the attribute. This actually calls "name" in HTML::Object::Attribute

ownerElement

This returns the attribute associated element, if any.

parent

This returns the attribute associated element, if any.

prefix

Always returns undef

string_value

Returns the attribute value.

to_boolean

Returns a true boolean object if the attribute value is true, or a false boolean object otherwise.

to_literal

Returns the attribute value.

to_number

Returns a new HTML::Object::Number object based on the attribute value.

toString

Returns a string, such as: name="value"

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

Mozilla reference

W3C standard on attributes

COPYRIGHT & LICENSE

Copyright(c) 2021 DEGUEST Pte. Ltd.

All rights reserved

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.