Public Member Functions | |
| __construct ($tag_name, $attributes=null) | |
| Create a new document element. | |
Attribute methods | |
| has_attributes () | |
| Return whether this element has attributes. | |
| has_attribute ($name) | |
| Check whether this element has the given attribute. | |
| get_attribute ($name) | |
| Get value for the given attribute. | |
| set_attribute ($name, $value) | |
| Set value for the given attribute. | |
| get_attributes () | |
| Get all attribute names and values. | |
| set_attributes ($attributes) | |
| Set multiple attributes at once. | |
| remove_attribute ($name) | |
| Remove the given attribute from this element. | |
Node methods | |
| append_child_text ($text) | |
| Append a text node. | |
| append_child_raw ($data) | |
| Append a raw text node. | |
Public Attributes | |
| $node_type = ANEWT_XML_DOM_ELEMENT_NODE | |
| The node type. | |
| $render_as_block = true | |
| Whether this element should be rendered as a block (the default). | |
| $always_render_closing_tag = false | |
| Whether the closing tag for this element should always be rendered in full instead of using shorthand notation. | |
Protected Attributes | |
| $_attributes = array() | |
| Hash of all attributes. | |
Rendering methods | |
| render ($indent_level=0) | |
| Render this element to a string. | |
| _build_attribute_string () | |
| Build an attribute string for this element. | |
This is a node type that corresponds to an XML element (tag). Note that the attribute API does not strictly match the W3C DOM standard. Instead of using a special attribute class, a simple associative-array based approach is used. This means there is no get_attribute_node method. instead, use methods such as get_attribute instead to retrieve the (string) value of an attribute.
Definition at line 862 of file dom.lib.php.
| AnewtXMLDomElement::__construct | ( | $ | tag_name, | |
| $ | attributes = null | |||
| ) |
Create a new document element.
| $tag_name | The tag name for this element | |
| $attributes | Associative array with initial attribute values for this element (optional). This parameter is for convenience only; you can always set attributes later. |
Reimplemented in AnewtXHTMLElement.
Definition at line 898 of file dom.lib.php.
| AnewtXMLDomElement::has_attributes | ( | ) |
Return whether this element has attributes.
Definition at line 919 of file dom.lib.php.
| AnewtXMLDomElement::has_attribute | ( | $ | name | ) |
Check whether this element has the given attribute.
| $name | The attribute name to test. |
Definition at line 933 of file dom.lib.php.
| AnewtXMLDomElement::get_attribute | ( | $ | name | ) |
Get value for the given attribute.
The attribute must be set for this method to succeed.
| $name | The name of attribute to retrieve the value for. |
Definition at line 954 of file dom.lib.php.
| AnewtXMLDomElement::set_attribute | ( | $ | name, | |
| $ | value | |||
| ) |
Set value for the given attribute.
| $name | The name of attribute for which to set the value. | |
| $value | The value of the attribute. |
Definition at line 974 of file dom.lib.php.
| AnewtXMLDomElement::get_attributes | ( | ) |
Get all attribute names and values.
Definition at line 995 of file dom.lib.php.
| AnewtXMLDomElement::set_attributes | ( | $ | attributes | ) |
Set multiple attributes at once.
This is a convenience method.
| $attributes | Associative array of attributes. |
Definition at line 1011 of file dom.lib.php.
| AnewtXMLDomElement::remove_attribute | ( | $ | name | ) |
Remove the given attribute from this element.
This function does nothing if the attribute was not set.
| $name | The name of attribute to remove. |
Definition at line 1026 of file dom.lib.php.
| AnewtXMLDomElement::append_child_text | ( | $ | text | ) |
Append a text node.
| $text | The text to append. |
Definition at line 1049 of file dom.lib.php.
| AnewtXMLDomElement::append_child_raw | ( | $ | data | ) |
Append a raw text node.
| $data | The raw text to append. |
Definition at line 1063 of file dom.lib.php.
| AnewtXMLDomElement::_build_attribute_string | ( | ) | [private] |
Build an attribute string for this element.
name=value pairs. Definition at line 1080 of file dom.lib.php.
| AnewtXMLDomElement::render | ( | $ | indent_level = 0 |
) |
Render this element to a string.
| $indent_level | The indentation level to use for block level elements. Don't specify this attribute when calling this method, it's useful for internal purposes only. |
Reimplemented in AnewtXHTMLListBase.
Definition at line 1108 of file dom.lib.php.
| AnewtXMLDomElement::$node_type = ANEWT_XML_DOM_ELEMENT_NODE |
AnewtXMLDomElement::$_attributes = array() [protected] |
Hash of all attributes.
Reimplemented from AnewtXMLDomNode.
Definition at line 865 of file dom.lib.php.
| AnewtXMLDomElement::$render_as_block = true |
Whether this element should be rendered as a block (the default).
If false, the element is rendered inline, without indentation and surrounding newlines.
Reimplemented in AnewtXHTMLBlockElement, and AnewtXHTMLInlineElement.
Definition at line 872 of file dom.lib.php.
| AnewtXMLDomElement::$always_render_closing_tag = false |
Whether the closing tag for this element should always be rendered in full instead of using shorthand notation.
This is needed for e.g. the script tag in XHTML because of browser imcompatibilities.
Reimplemented in AnewtXHTMLElement, AnewtXHTMLInput, AnewtXHTMLButton, AnewtXHTMLLink, AnewtXHTMLBase, AnewtXHTMLImage, AnewtXHTMLMeta, and AnewtXHTMLBreak.
Definition at line 879 of file dom.lib.php.
1.5.9