DiDom\Document::xml PHP Method

xml() public method

Dumps the internal document into a string using XML formatting.
public xml ( integer $options ) : string
$options integer Additional options
return string The document xml
    public function xml($options = 0)
    {
        return trim($this->document->saveXML($this->document, $options));
    }

Usage Example

Example #1
0
 public function testToStringXml()
 {
     $xml = $this->loadFixture('books.xml');
     $document = new Document($xml, false, 'UTF-8', 'xml');
     $this->assertEquals($document->xml(), $document->__toString());
 }