Inheritance diagram for ElementCreator:

To be exact, you can create any DOMNode descendant in this class descendants.
Definition at line 50 of file xmlutils.php.
Public Member Functions | |
| __construct ($name, $attrs=NULL) | |
| create_element ($doc, $content=NULL) | |
| Call this to get new XML element. | |
Protected Attributes | |
| $attrs = array() | |
| Element's attributes. | |
| $name | |
| Element's name. | |
|
||||||||||||
|
Definition at line 64 of file xmlutils.php. 00064 {
00065 $this->name = $name;
00066 if ($attrs):
00067 $this->attrs = $attrs;
00068 endif;
00069 }
|
|
||||||||||||
|
Call this to get new XML element. By default it creates a DOMElement but descendants can return arbitrary DOMNode descendant.
Reimplemented in LinkElementCreator, and ExtractingElementCreator. Definition at line 82 of file xmlutils.php. 00082 {
00083 $elem = $doc->createElement($this->name);
00084 foreach ($this->attrs as $name => $value):
00085 $elem->setAttribute($name, $value);
00086 endforeach;
00087 if ($content):
00088 $contentNode = $doc->createTextNode($content);
00089 $elem->appendChild($contentNode);
00090 endif;
00091 return $elem;
00092 }
|
|
|
Element's attributes. Keys are used as attribute names, values as their values. Definition at line 57 of file xmlutils.php. Referenced by __construct(). |
|
|
Element's name.
Definition at line 53 of file xmlutils.php. Referenced by __construct(). |
1.4.2