Source for file XMLElement.php
Documentation is available at XMLElement.php
* $Source: /cvsroot/svggrapher/svggrapher/XMLElement.php,v $
* @version CVS: $Id: XMLElement.php,v 1.5 2007/10/23 09:22:51 geelweb Exp $
* @author Guillaume Luchet. <guillaume@geelweb.org>
* @copyright Copyright (c) 2007, Guillaume Luchet.
* @license http://opensource.org/licenses/bsd-license.php BSD License
* indentation, 4 space default
if(!defined('MAX_CHAR_PER_LINE')) {
define('MAX_CHAR_PER_LINE', 80);
* @version CVS: $Id: XMLElement.php,v 1.5 2007/10/23 09:22:51 geelweb Exp $
* @copyright Copyright (c) 2007, Guillaume Luchet
* @author guillaume luchet <guillaume@geelweb.org>
* @license http://opensource.org/licenses/bsd-license.php BSD License
// XMLElement::__construct() {{{
public function __construct($name, $atts=
array(), $content=
NULL)
foreach($atts as $name=>
$value) {
// XMLElement::__set() {{{
public function __set($name, $value)
return $this->$setter($value);
return $this->$name =
$value;
// XMLElement::__get() {{{
public function __get($name)
// XMLElement::setAttribute() {{{
// XMLElement::getAttribute() {{{
$getter =
'_get' .
$name .
'Attribute';
// XMLElement::appendChild() {{{
* @param XMLElement $child
if(false ===
$child->parent) {
// XMLElement::asXML() {{{
$tagTpl =
'<{$TAG}{$ATTRIBUTES}>{$CONTENT}</{$TAG}>';
$atts .=
' ' .
$key .
'="' .
$value .
'"';
$content .=
$child->asXML();
array('{$TAG}', '{$ATTRIBUTES}', '{$CONTENT}'),
array($this->name, $atts, $content), $tagTpl);
// XMLElement::asPrettyXML() {{{
* @param int $level node level
$string[$line] =
$padding .
'<' .
$this->name;
$attr =
' ' .
$key .
'="' .
$value .
'"';
$xml .=
'</' .
$this->name .
'>';
// XMLElement::saveXML() {{{
public function saveXML($filename, $compress=
false)
$fh =
fopen($filename, 'w');
return $return !==
false;
// XMLElement::_getStyleAttribute() {{{
* Return the element style
// XMLElement::_getTransformAttribute() {{{
* Return the element transformation
Documentation generated on Tue, 23 Oct 2007 11:32:22 +0200 by phpDocumentor 1.4.0