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 = new XMLWriter(); 13$xw->openUri($doc_dest); 14$xw->startDtd('foo', NULL, 'urn:bar'); 15$xw->endDtd(); 16$xw->startElement('foo'); 17$xw->writeElementNS('foo', 'bar', 'urn:foo', 'dummy content'); 18$xw->endElement(); 19 20// Force to write and empty the buffer 21$output_bytes = $xw->flush(true); 22echo file_get_contents($doc_dest); 23unset($xw); 24unlink('001.xml'); 25?> 26--EXPECT-- 27<!DOCTYPE foo SYSTEM "urn:bar"><foo><foo:bar xmlns:foo="urn:foo">dummy content</foo:bar></foo> 28