FluidXml\FluidXml::xml PHP Метод

xml() публичный Метод

public xml ( $strip = false )
    public function xml($strip = false)
    {
        if ($strip) {
            return FluidHelper::domdocumentToStringWithoutHeaders($this->document->dom);
        }
        return $this->document->dom->saveXML();
    }

Usage Example

Пример #1
0
            $actual = $xml->xml();
            $expected = $alias->xml();
            \assert($actual === $expected, __($actual, $expected));
        });
    });
    describe('.cdata', function () {
        it('should be fluid', function () {
            assert_is_fluid('cdata', 'a');
        });
        it('should behave like .setCdata', function () {
            $xml = new FluidXml();
            $xml->setCdata('Text1')->appendChild('child', true)->setCdata('Text2');
            $alias = new FluidXml();
            $alias->cdata('Text1')->appendChild('child', true)->cdata('Text2');
            $actual = $xml->xml();
            $expected = $alias->xml();
            \assert($actual === $expected, __($actual, $expected));
        });
    });
});
describe('FluidContext', function () {
    it('should be iterable returning the represented DOMNode objects', function () {
        $xml = new FluidXml();
        $cx = $xml->appendChild(['head', 'body'], true);
        $actual = $cx;
        assert_is_a($actual, \Iterator::class);
        $representation = [];
        foreach ($cx as $k => $v) {
            $actual = \is_int($k);
            $expected = true;
            \assert($actual === $expected, __($actual, $expected));
All Usage Examples Of FluidXml\FluidXml::xml