Dotclear 2.25
|
Public Member Functions | |
__construct (?string $name=null, $content=null) | |
__set (string $name, mixed $value) | |
__call (string $name, array $args) | |
CDATA (string $value) | |
insertAttr (string $name, mixed $value) | |
insertNode ($node=null) | |
toXML (bool $prolog=false, string $encoding='UTF-8') | |
XML Tree
__construct | ( | ?string | $name = null , |
$content = null |
|||
) |
Constructor
Creates the root XML tag named $name. If content is given, it will be appended to root tag with insertNode()
string | $name | Tag name |
mixed | $content | Tag content |
References insertNode().
__set | ( | string | $name, |
mixed | $value | ||
) |
Add Attribute
Magic __set method to add an attribute.
string | $name | Attribute name |
mixed | $value | Attribute value |
References insertAttr().
__call | ( | string | $name, |
array | $args | ||
) |
Add a tag
This magic __call method appends a tag to XML tree.
string | $name | Tag name |
array | $args | Function arguments, the first one would be tag content |
References insertNode().
CDATA | ( | string | $value | ) |
Add CDATA
Appends CDATA to current tag.
string | $value | Tag CDATA content |
References insertNode().
insertAttr | ( | string | $name, |
mixed | $value | ||
) |
Add Attribute
This method adds an attribute to current tag.
string | $name | Attribute name |
mixed | $value | Attribute value |
Referenced by __set().
insertNode | ( | $node = null | ) |
Insert Node
This method adds a new XML node. Node could be a instance of xmlTag, an array of valid values, a boolean or a string.
xmlTag | array | bool | string | $node | Node value |
Referenced by __call(), __construct(), and CDATA().
toXML | ( | bool | $prolog = false , |
string | $encoding = 'UTF-8' |
||
) |
XML Result
Returns a string with XML content.
bool | $prolog | Append prolog to result |
string | $encoding | Result charset |