DOMDocumentFragment_appendXML_basic_001.phpt 556 B

12345678910111213141516171819202122
  1. --TEST--
  2. DOMDocumentFragment::appendXML() with children with properties.
  3. --CREDITS--
  4. Eric Lee Stewart <ericleestewart@gmail.com>
  5. # TestFest Atlanta 2009-05-24
  6. --SKIPIF--
  7. <?php require_once('skipif.inc'); ?>
  8. --FILE--
  9. <?php
  10. $document = new DOMDocument;
  11. $root = $document->createElement('root');
  12. $document->appendChild($root);
  13. $fragment = $document->createDocumentFragment();
  14. $fragment->appendXML('<foo id="baz">bar</foo>');
  15. $root->appendChild($fragment);
  16. print $document->saveXML();
  17. ?>
  18. --EXPECT--
  19. <?xml version="1.0"?>
  20. <root><foo id="baz">bar</foo></root>