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