PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Troubleshooting

Reply
 
Thread Tools
Old 01-17-2004, 12:59 PM   #1
paullind
Orange Mole
 
Join Date: Jan 2004
Posts: 30
XML error

I am using the page search.php in the root of phpdig folder.

I then try to perform a search . If there are no results it seems to be ok, but when there are results to display I get this error:

The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.

I am using Windows2000 IIS. I noticed in a similar post that this may be a safe_mode issue so I checked php.ini and they are set to off (safe_mode and safe_mode_gid)

Is it a server/safe mode issue or just a newbie XML problem ?
(I am XML challenged at the moment)

Any input would be greatly appreciated.

Paul L
cdncc@cdncc.com
paullind is offline   Reply With Quote
Old 01-18-2004, 05:49 AM   #2
paullind
Orange Mole
 
Join Date: Jan 2004
Posts: 30
addition

this was the next line from the error page , i forgot to include it in the original post:

Only one top level element is allowed in an XML document. Error processing resource 'http://me.homeunix.org/phpdig/search.php?template_demo=.%2Ftemplates%2Fphpdig.html&site=0&path=&result_pa ge=search.php&query_string=cdn&search=Go...&limite=10&option=start'. Line 2, Position 2

<b>Notice</b>: Undefined variable: match_this_spot in <b>c:\inetpub\wwwroot\phpdig\libs\search_function.php</b> on line <b>332</b><br />
-^
paullind is offline   Reply With Quote
Old 01-18-2004, 08:02 AM   #3
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. In the search_function.php file, change:
PHP Code:
if(eregi($reg_strings,$extract_content)) {
   
$match_this_spot str_replace('<','&lt;',str_replace('>','&gt;',trim($match_this_spot)));
   
$match_this_spot eregi_replace($reg_strings,"\\1<\\2>\\3",$extract_content);
   
$first_bold_spot strpos($match_this_spot,"<");
   
$first_bold_spot max($first_bold_spot round((SNIPPET_DISPLAY_LENGTH 2),0), 0);
   
$extract_content substr($extract_content,$first_bold_spot,max(SNIPPET_DISPLAY_LENGTHstrlen($query_string)));
   
$extract .= ' ...'.phpdigHighlight($reg_strings,str_replace('<','&lt;',str_replace('>','&gt;',trim($extract_content)))).'... ';
   
$num_extracts++;

to the following:
PHP Code:
if(eregi($reg_strings,$extract_content)) {
   
$extract_content str_replace('<','&lt;',str_replace('>','&gt;',trim($extract_content)));
   
$match_this_spot eregi_replace($reg_strings,"\\1<\\2>\\3",$extract_content);
   
$first_bold_spot strpos($match_this_spot,"<");
   
$first_bold_spot max($first_bold_spot round((SNIPPET_DISPLAY_LENGTH 2),0), 0);
   
$extract_content substr($extract_content,$first_bold_spot,max(SNIPPET_DISPLAY_LENGTHstrlen($query_string)));
   
$extract .= ' ...'.phpdigHighlight($reg_strings,$extract_content).'... ';
   
$num_extracts++;

Remember to remove any "word" wrapping in the above code.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 01-18-2004, 12:28 PM   #4
paullind
Orange Mole
 
Join Date: Jan 2004
Posts: 30
thank you

Thanks Charter-Administrator

that did the trick !!!
paullind is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
XML problems? Dave A Troubleshooting 0 12-30-2005 01:05 AM
XML output GunMuse Mod Requests 0 02-19-2005 11:50 AM
XML error with spider.php... Grantome Troubleshooting 7 09-07-2004 04:03 PM
XML error babyboy External Binaries 1 09-07-2004 04:00 PM
XML feeds sid Mod Requests 5 03-21-2004 08:12 PM


All times are GMT -8. The time now is 07:20 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.