getEncoding() public method

public getEncoding ( ) : string
return string encoding of this XML document
Example #1
0
 public function testLoadFromString()
 {
     $xmlStr = '<?xml version="1.0" encoding="UTF-8"?><rootNode><node id="node1" param="attribute1"/><node id="node2" param="attribute2"/></rootNode>';
     $xmldoc = new TXmlDocument();
     self::assertTrue($xmldoc->loadFromString($xmlStr));
     self::assertEquals('1.0', $xmldoc->getVersion());
     self::assertEquals('UTF-8', $xmldoc->getEncoding());
 }