|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-06-28 18:09 UTC] paul at sparrowhawkcomputing dot com
[2018-04-02 22:51 UTC] cmb@php.net
-Status: Open
+Status: Verified
-Type: Bug
+Type: Documentation Problem
[2018-04-02 22:51 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 22:00:01 2025 UTC |
Description: ------------ XMLWriter adds namespace definitions to any element node that is created by by a namespace aware method. It does not take definitions on parent nodes into account. The resulting XML output is valid and has even the same meaning, but it is a lot larger then needed. Test script: --------------- <?php $_ = new XMLWriter(); $_->openMemory(); $_->setIndent(2); $_->startDocument(); $_->startElementNS('a', 'foo', 'urn:a'); $_->writeElementNS('a', 'bar', 'urn:a', 'foobar'); $_->endElement(); $_->endDocument(); echo $_->outputMemory(); Expected result: ---------------- <?xml version="1.0"?> <a:foo xmlns:a="urn:a"> <a:bar>foobar</a:bar> </a:foo> Actual result: -------------- <?xml version="1.0"?> <a:foo xmlns:a="urn:a"> <a:bar xmlns:a="urn:a">foobar</a:bar> </a:foo>