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