loadXml() public method

Load XML from a string.
public loadXml ( string $xml, integer $options ) : Document
$xml string The XML string
$options integer Additional parameters
return Document
Ejemplo n.º 1
0
 public function testXmlWithOptions()
 {
     $xml = '<foo><bar></bar></foo>';
     $document = new Document();
     $document->loadXml($xml);
     $prolog = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
     $this->assertEquals($prolog . '<foo><bar/></foo>', $document->xml());
     $this->assertEquals($prolog . '<foo><bar></bar></foo>', $document->xml(LIBXML_NOEMPTYTAG));
 }