php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23000 Multiple XML declarations in one document
Submitted: 2003-04-01 04:26 UTC Modified: 2003-04-01 06:28 UTC
From: raoul at nexus dot net dot nz Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 4.3.1 OS: RedHat 8.0 Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: raoul at nexus dot net dot nz
New email:
PHP Version: OS:

 

 [2003-04-01 04:26 UTC] raoul at nexus dot net dot nz
My configuration compile line is;
./configure' '--enable-ctype' '--with-xml' '--with-xmlrpc' '--enable-xslt' '--with-sablot-js' '--enable-xslt' '--with-xslt-sablot' '--with-dom' '--with-openssl' '--with-sockets' '--with-curl=../dependencies/curl-7.10.3' '--with-pgsql' '--with-mhash=../dependencies/mhash-0.8.18' '--with-ming' '--with-imap=../dependencies/imap-2002b' '--with-freetype-dir=../dependencies/freetype-2.1.4rc1' '--with-zlib-dir=../dependencies/zlib-1.1.4' '--with-gd' '--enable-gd-native-ttf' '--enable-gd-imgstrttf' '--with-jpeg-dir=/usr/lib' '--with-png-dir=/usr/lib' '--enable-mbstring' '--enable-mbstr-enc-trans' '--with-apxs'

The code that creates the bug;
	$doc = domxml_new_doc("1.0");
	$layoutsListNode = $doc->create_element('Response');
	$layoutsListNode->set_attribute('message', $message);
	$layoutsListNode->set_attribute('baseObject', $baseObject);
	$layoutsListNode = $doc->append_child($layoutsListNode);
	echo $doc->dump_mem());

The page that uses the above code serves mutiple requests from a Flash movie using XML over HTTP. Each time I call this page from my Flash movie the XML declaration gets repeated in the response back to the Flash client. The number of extra tags corresponds exactly with the number of requests done from the Flash movie during that Flash session. In theory each request is in a seperate HTTP request so I would have thought PHP and Flash would not have been able to do this.

It looks to me that Flash is keeping the HTTP session alive during is lifetime but for some reason PHP is getting a bit confused from client request to client request.

I have found a temporary work around but it is an ugly hack.
echo str_replace("<?xml version=\"1.0\"?>", "", $doc->dump_mem());

As Flash does not need the declaration tag, doesn't cause any harm here.

Any thoughts?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-01 06:28 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

.

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Nov 22 02:01:23 2019 UTC