note 59470 deleted from function.dom-domnode-appendchild by nlopess
| From: | nlopess@php.net | Date: | Wed, 07 Dec 2005 22:05:54 +0000 |
| Subject: | note 59470 deleted from function.dom-domnode-appendchild by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-99706@lists.php.net to get a copy of this message | ||
Note Submitter: manuel at mononeurona dot org
Reason: useless
----
A function (inside a class) to generate XML node (with spanish support) from database table using
PEAR database layer:
public function setGalerias() {
$R = $this->db->query("SELECT id, title FROM gallerys");
$ar = $this->doc->createElement("gallerys");
$ar = $this->root->appendChild($ar);
while ($R->fetchInto($row)) {
$temp = $this->doc->createElement('gals');
$temp = $ar->appendChild($temp);
$value = $this->doc->createTextNode('gals' . "\n");
$value = $ar->appendChild($value);
$child = $this->doc->createElement( 'id' );
$temp->appendChild( $child )->appendChild( $this->doc->createTextNode( $row[0] ) );
$text = mb_convert_encoding(trim($row[1]), "iso-8859-1", "UTF-8");
$child = $this->doc->createElement( 'titulo' );
$temp->appendChild( $child )->appendChild( $this->doc->createTextNode( $text .
"\n") );
}
}