php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41467 Extra content at the end of the document
Submitted: 2007-05-23 01:58 UTC Modified: 2007-06-05 01:00 UTC
Votes:9
Avg. Score:3.6 ± 0.8
Reproduced:7 of 8 (87.5%)
Same Version:5 (71.4%)
Same OS:2 (28.6%)
From: el_lenyas at hotmail dot com Assigned:
Status: No Feedback Package: DOM XML related
PHP Version: 5.2.2 OS: Windows Xp Sp2
Private report: No CVE-ID: None
 [2007-05-23 01:58 UTC] el_lenyas at hotmail dot com
Description:
------------
I have problem, tryin to fill and xml document. I load an xml i fill whith new information, but when is going to put the third node it says 
Extra content at the end of the document, and deletes the second node.
It makes 2 nodes but when I try to make third node it says that error and delete the second node.




Reproduce code:
---------------
$usuario="ricardo";
$promedio=1000;
$doc = new DOMDocument('1.0');
$doc->formatOutput = true;
$xml=strval('http://localhost/chat_xml/test2.xml');
$doc->load($xml);

$item = $doc->appendChild($doc->createElement('item'));
$nick= $item->appendChild($doc->createElement('nick'));
$nick->appendChild($doc->createTextNode('Ricardo'));
$time= $item->appendChild($doc->createElement('time'));
$time->appendChild($doc->createTextNode(time()));
$rating= $item->appendChild($doc->createElement('rating'));
$rating->appendChild($doc->createTextNode($promedio));
echo 'Wrote: ' . $doc->save("test2.xml") . ' bytes'; 



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-28 15:12 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

Providing reproduce code depending on a local resource makes no sense.
 [2007-06-05 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2008-08-19 17:55 UTC] chandu dot mankar444 at gmail dot com
<?php

//*****************************************************
//*	     Copyright 2006 - earnfromyoursite.com        *
//*           http://www.Makemoneyfromindia.com/            *
//*****************************************************

//***************** IMPORTANT NOTE ********************
//DO 9:44 PM 8/14/20089:44 PM 8/14/2008NOT DISPLAY GOOGLE's REFFERRAL 

PROGRAM ADVERTISEMENT
//WITH YAHOO ADS!!

//************** WEBSITE CONFIGURATION ****************
// Enter the name of your website
$sitename = "Makemoneyfromindia.com";
// Enter the FULL URL of your website
$siteurl = 'http://www.makemoneyfromindia.com/';
// Insert your domain name here for copyright info
$copyinfo = 'makemoneyfromindia.com';
//***************** DISPLAY SETTINGS ******************
// Display Google/Yahoo Advertisments
// (0=None, 1=Google, 2=Yahoo)
$adtype = '1';
//***************** SEARCH SETTINGS *******************
// Display Google Search Box (0=None, 1=Yes, 2=No)
$display_search = '1';
//*****************************************************

//************ GOOGLE ADVERTISEMENT SETTINGS **********
// Google AdSense ID (http://www.google.com/adsense/)
$adsenseid = 'pub-111111111111111';

// Google AdSense Channel ID
$adsensechannelid = '';

// Do NOT display with Yahoo ads!!!
// Display Referral Program (1=Yes, 2=No)
$rerrals = '1';
//*****************************************************

//************ YAHOO ADVERTISEMENT SETTINGS ***********
// Yahoo Publisher ID (http://publisher.yahoo.com/)
$yahooid = '1111111111';

// Yahoo Channel ID
$yahoochannelid = '';
//*****************************************************

//*********** AMAZON ADVERTISEMENT SETTINGS ***********
// Enter your Amazon ID (https://associates.amazon.com/)
$amazonid = 'a2z-20';
// Enter the amazon category here: (See the adsensepages_instructions.txt for amazon 

modes)
$amazonmode='videogames';
//Amazon Keyword for above category
$amazonkeyword = 'Monopoly';

//********* DO NOT EDIT BELOW THIS LINE!!! ************
$navpoint = 'square';
$auto_filename = 'auto.txt';

?>
 [2008-12-03 09:30 UTC] rishi dot ambala at gmail dot com
<?php

//*****************************************************
//*	     Copyright 2006 - earnfromyoursite.com        *
//*           http://www.earnfromyoursite.com/            *
//*****************************************************

//***************** IMPORTANT NOTE ********************
//DO 9:44 PM 8/14/20089:44 PM 8/14/2008NOT DISPLAY GOOGLE's REFFERRAL 

PROGRAM ADVERTISEMENT
//WITH YAHOO ADS!!

//************** WEBSITE CONFIGURATION ****************
// Enter the name of your website
$sitename = "earnfromyoursite.com";
// Enter the FULL URL of your website
$siteurl = 'http://www.earnfromyoursite.com/';
// Insert your domain name here for copyright info
$copyinfo = 'earnfromyoursite.com';
//***************** DISPLAY SETTINGS ******************
// Display Google/Yahoo Advertisments
// (0=None, 1=Google, 2=Yahoo)
$adtype = '1';
//***************** SEARCH SETTINGS *******************
// Display Google Search Box (0=None, 1=Yes, 2=No)
$display_search = '1';
//*****************************************************

//************ GOOGLE ADVERTISEMENT SETTINGS **********
// Google AdSense ID (http://www.google.com/adsense/)
$adsenseid = 'pub-111111111111111';

// Google AdSense Channel ID
$adsensechannelid = '';

// Do NOT display with Yahoo ads!!!
// Display Referral Program (1=Yes, 2=No)
$rerrals = '1';
//*****************************************************

//************ YAHOO ADVERTISEMENT SETTINGS ***********
// Yahoo Publisher ID (http://publisher.yahoo.com/)
$yahooid = '1111111111';

// Yahoo Channel ID
$yahoochannelid = '';
//*****************************************************

//*********** AMAZON ADVERTISEMENT SETTINGS ***********
// Enter your Amazon ID (https://associates.amazon.com/)
$amazonid = 'a2z-20';
// Enter the amazon category here: (See the
adsensepages_instructions.txt for amazon 

modes)
$amazonmode='videogames';
//Amazon Keyword for above category
$amazonkeyword = 'Monopoly';

//********* DO NOT EDIT BELOW THIS LINE!!! ************
$navpoint = 'square';
$auto_filename = 'auto.txt';

?>
 [2009-02-09 12:28 UTC] pxyz44 at gmail dot com
I M UNABLE TO CREATE WEBSITE FROM GOOGLE CASH
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC