All pastes #270865 Raw Edit

Miscellany

public text v1 · immutable
·published 2006-12-07 19:41 UTC
rendered paste body
$dom = new domDocument("1.0","ISO-8859-1");
  $dom->formatOutput = 1;
  $root = $dom->createElement('forum'');
  $root->setAttribute('uri=http://fudforum.org/index.php');
   
   $branch =$domcreateElement('item');
   $branch->setAttribute('id', "1");
     $leaf = $dom->createElement(title);
     $leaf->appendChild($dom->createTextNode('First Post'));
   $branch->appendChild($leaf);

     $leaf = $dom->createElement('link');
     $leaf->appendChild($dom->createTextNode('//fudforum.org/index.php/m/1'));
   $branch->appendChild($leaf);

     $leaf = $dom->createElement('description');
     $leaf->appendChild($dom->createTextNode('first message in forum'));
   $branch->appendChild($leaf);

   $branch =$domcreateElement('item');
   $branch->setAttribute('id', "2");
     $leaf = $dom->createElement(title);
     $leaf->appendChild($dom->createTextNode('First Post'));
   $branch->appendChild($leaf);

     $leaf = $dom->createElement('link');
     $leaf->appendChild($dom->createTextNode('//fudforum.org/index.php/m/1'));
   $branch->appendChild($leaf);

     $leaf = $dom->createElement('description');
     $leaf->appendChild($dom->createTextNode('almost like slashdor'));
   $branch->appendChild($leaf);

$root->appendChild($branch);
$dom->appendChild($root);
echo $dom->saveXML();