Ejemplo n.º 1
0
 function toElement()
 {
     $stream = new Output\Stream();
     $writer = new XML\Text\Writer(new Output\Writer($stream));
     $writer->writeNode($this);
     $filter = new XML\Filter\SimpleXML();
     return $filter((string) $stream);
 }
Ejemplo n.º 2
0
<?php

use IO\Output;
use DBAL\XML;
use DBAL\Data\Tree;
$output = new Output\Stream();
$writer = new Output\Writer($output);
$docWriter = new XML\Text\Writer($writer);
$node = new Tree\Node('test');
$attr = array('test' => 'someValue', 'attr' => 2);
$subnode = new Tree\Node('subnode', $attr, $node);
$docWriter->writeDocument($node);
echo (string) $output;