Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

domxml_open_mem(): Extra content at the end of the document

Status
Not open for further replies.

hksoftware

Technical User
Feb 13, 2003
66
0
0
GB
I'm loading an XML document and then parsing it.
This script works fine of all of my clients except 1.

His domxml_open_mem() function dies, saying:
Extra content at the end of the document

So I checked the XML file and the end looks like this:


</Question>
</ResultSet>
<!--
ws02.search.re2.yahoo.com compressed/chunked Wed Aug 15 04:09:16 PDT 2007
-->


So I added the following gode to remove that comment:


// Remove any trailing content.
$endpos=strpos($xml,'</ResultSet>');
$endpos=$endpos+12;
$xml=substr($xml,0,$endpos);


So now the end of the XML document looks like this (as it should):


</Question>
</ResultSet>


But he's still getting the same error.
What is his DOMXML not liking about the end of the XML document that no others mind?
 
Sussed it. It wan't even retrieving the XML document as allow_url_fopen() was disabled!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top