xref: /PHP-8.1/ext/xmlwriter/tests/OO_006.phpt (revision 74859783)
1--TEST--
2XMLWriter: libxml2 XML Writer, startDTD/writeElementNS
3--EXTENSIONS--
4xmlwriter
5--FILE--
6<?php
7
8$doc_dest = 'OO_006.xml';
9$xw = new XMLWriter();
10$xw->openUri($doc_dest);
11$xw->startDtd('foo', NULL, 'urn:bar');
12$xw->endDtd();
13$xw->startElement('foo');
14$xw->writeElementNS('foo', 'bar', 'urn:foo', 'dummy content');
15$xw->endElement();
16
17// Force to write and empty the buffer
18$output_bytes = $xw->flush(true);
19echo file_get_contents($doc_dest);
20unset($xw);
21unlink($doc_dest);
22?>
23--EXPECT--
24<!DOCTYPE foo SYSTEM "urn:bar"><foo><foo:bar xmlns:foo="urn:foo">dummy content</foo:bar></foo>
25