summaryrefslogtreecommitdiff
path: root/ext/xmlwriter/tests/xmlwriter_write_attribute_ns_basic_001.phpt
blob: 090327b66639486dd6aad981f905b0adf99e5591 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--TEST--
xmlwriter_write_attribute_ns basic function tests
--SKIPIF--
<?php if (!extension_loaded("xmlwriter")) print "skip"; ?>
--FILE--
<?php
$xw = xmlwriter_open_memory();
xmlwriter_set_indent($xw, TRUE);
xmlwriter_start_document($xw, NULL, "UTF-8");
xmlwriter_start_element($xw, 'root');
xmlwriter_write_attribute_ns($xw, 'prefix', 'id', 'http://www.php.net/uri', 'elem1');
xmlwriter_start_element($xw, 'elem1');
xmlwriter_write_attribute($xw, 'attr1', 'first');
xmlwriter_end_element($xw);
xmlwriter_full_end_element($xw);
xmlwriter_end_document($xw);

$output = xmlwriter_flush($xw, true);
print $output;
?>
--CREDIT--
Koen Kuipers koenk82@gmail.com
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<root prefix:id="elem1" xmlns:prefix="http://www.php.net/uri">
 <elem1 attr1="first"/>
</root>