The manakai project

Web::DOM::Attr

DOM Attr object

DESCRIPTION

The Web::DOM::Attr class implements the DOM Attr interface. An Attr object represents a content attribute of an element.

METHODS

The methods of classes Web::DOM::EventTarget and Web::DOM::Node are available on a Attr object, as well as following methods:

$node = $node->manakai_append_text ($string)

Append a string to the value of the attribute. [MANAKAI]

$attr->manakai_append_indexed_string ($indexed)

Append an IndexedString <http://wiki.suikawiki.org/n/manakai%20index%20data%20structures#anchor-1> to the value of the attribute. [MANAKAIINDEX]

$code = $attr->manakai_attribute_type
$attr->manakai_attribute_type ($code)

Return or set the DTD attribute type for the attribute. [MANAKAI]

$indexed = $attr->manakai_get_indexed_string

Return an IndexedString <http://wiki.suikawiki.org/n/manakai%20index%20data%20structures#anchor-1> representation of the value of the attribute. [MANAKAIINDEX]

$bool = $attr->is_id

Return whether the attribute is id or not. [MANAKAI]

$name = $attr->local_name
$name = $attr->manakai_local_name [DEPRECATED]

Return the local name of the attribute. [DOM] [MANAKAI]

$url = $attr->namespace_uri

Return the namespace URL of the attribute. If the attribute does not belong to any namespace, undef is returned. [DOM]

$el = $attr->owner_element

Return the element to which the attribute is set. If there is no such an element, undef is returned. [DOM]

$name = $attr->name
$name = $attr->node_name
$name = $attr->manakai_name [DEPRECATED]

Return the attribute name. [DOM] [MANAKAI]

$prefix = $attr->prefix
$attr->prefix ($prefix)

If no argument is specified, return the namespace prefix of the element, if any, or undef. [DOM]

If the argument is specified, the value is set as the namespace prefix of the element. If the value is undef, the namespace prefix is removed. [DOMNODEEXODUS] [MANAKAI]

$bool = $attr->specified

Return true for backward compatibility. [DOM]

$value = $attr->value
$value = $attr->text_content
$value = $attr->node_value
$attr->value ($value)
$attr->text_content ($value)
$attr->node_value ($value)

Return or set the attribute value. [DOM]

CONSTANTS

Constants are exported from the Web::DOM::Attr module by default. In addition, they are accessible as methods of Attr objects.

Following declared type constants used by the manakai_attribute_type attribute are exported [DOMDTDEF]:

NO_TYPE_ATTR CDATA_ATTR ID_ATTR IDREF_ATTR IDREFS_ATTR ENTITY_ATTR ENTITIES_ATTR NMTOKEN_ATTR NMTOKENS_ATTR NOTATION_ATTR ENUMERATION_ATTR UNKNOWN_ATTR

SPECIFICATIONS

DOM

DOM Standard <https://dom.spec.whatwg.org/#interface-attr>.

DOMNODEEXODUS

DOM Standard <view-source:https://dom.spec.whatwg.org/>.

DOMDTDEF

DOM Document Type Definitions <https://suika.suikawiki.org/www/markup/xml/domdtdef/domdtdef>.

MANAKAI

manakai DOM Extensions <https://suika.suikawiki.org/~wakaba/wiki/sw/n/manakai%20DOM%20Extensions>.

MANAKAIINDEX

manakai index data structures <https://wiki.suikawiki.org/n/manakai%20index%20data%20structures>.

SEE ALSO

Web::DOM::Node, Web::DOM::Element, Web::DOM::NamedNodeMap.

AUTHOR

Wakaba <wakaba@suikawiki.org>.

LICENSE

Copyright 2012-2016 Wakaba <wakaba@suikawiki.org>.

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