CRE Loaded Community

Banner


Board index » CRE Loaded Support » CRE Loaded 6.4

All times are UTC - 5 hours




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Error type: LoadXML Description: Incorrect XML
PostPosted: Thu Mar 04, 2010 4:26 pm 
Offline
CRE Freak

Joined: Thu Jun 25, 2009 6:58 am
Posts: 50
I receive the following error when adding a coupon.

Error type: LoadXML
Description: Incorrect XML

This happens when I try to either assign Valid Categories or Valid Products to that coupon. The pop-up window open which usually has products or categories to pick from.


Top
 Profile  
 
 Post subject: Re: Error type: LoadXML Description: Incorrect XML
PostPosted: Thu Mar 11, 2010 4:33 pm 
Offline
CRE Freak
User avatar

Joined: Thu Feb 28, 2008 9:09 pm
Posts: 53
in admin/get_categories.php you will see a function

Code:
  function str_rep($row){
    $row = str_replace('&', '&', $row);
    $row = str_replace('&', '&', $row);
    $row = str_replace('>', '>', $row);
    $row = str_replace('<', '&lt;', $row);
//ADD THIS FIX
    $row = str_replace('"', ' ', $row);
//ADD THIS FIX
    return $row;


You might be using " or ' in the title of the Categories or Products either remove them from the titles or clean them. Hope this will solve your problem.

_________________
Ecommerce Solution Provider
Ecommerce, CRE Loaded, Customization
Get your CRE Loaded store done today. Data Entry, Ebay and Amazon Inventory Management


Top
 Profile  
 
 Post subject: Re: Error type: LoadXML Description: Incorrect XML
PostPosted: Thu Mar 11, 2010 4:44 pm 
Offline
CRE Freak

Joined: Thu Jun 25, 2009 6:58 am
Posts: 50
Thanks
I checked my code and compared to the code you sent

//ADD THIS FIX
$row = str_replace('"', ' ', $row);
//ADD THIS FIX
return $row;

It was missing the two fixes so I added it and it fixed the problem.


Thanks again


Top
 Profile  
 
 Post subject: Re: Error type: LoadXML Description: Incorrect XML
PostPosted: Thu Mar 11, 2010 4:54 pm 
Offline
CRE Freak
User avatar

Joined: Thu Feb 28, 2008 9:09 pm
Posts: 53
:D

_________________
Ecommerce Solution Provider
Ecommerce, CRE Loaded, Customization
Get your CRE Loaded store done today. Data Entry, Ebay and Amazon Inventory Management


Top
 Profile  
 
 Post subject: Re: Error type: LoadXML Description: Incorrect XML
PostPosted: Fri Mar 12, 2010 2:40 pm 
Offline
CRE Freak

Joined: Thu Jun 25, 2009 6:58 am
Posts: 50
Darn I spoke too soon, it is still broken I was looking at the wrong page.

Any additional help?


Top
 Profile  
 
 Post subject: Re: Error type: LoadXML Description: Incorrect XML
PostPosted: Fri Mar 12, 2010 6:22 pm 
Offline
CRE Freak
User avatar

Joined: Thu Feb 28, 2008 9:09 pm
Posts: 53
post the error you are getting.

_________________
Ecommerce Solution Provider
Ecommerce, CRE Loaded, Customization
Get your CRE Loaded store done today. Data Entry, Ebay and Amazon Inventory Management


Top
 Profile  
 
 Post subject: Re: Error type: LoadXML Description: Incorrect XML
PostPosted: Fri Mar 12, 2010 8:20 pm 
Offline
CRE Freak

Joined: Thu Jun 25, 2009 6:58 am
Posts: 50
Error type: LoadXML
Description: Incorrect XML

This happens when I try to either assign Valid Categories or Valid Products to a new coupon. The pop-up window open which usually has products or categories to pick from.


Top
 Profile  
 
 Post subject: Re: Error type: LoadXML Description: Incorrect XML
PostPosted: Fri Mar 12, 2010 8:54 pm 
Offline
CRE Freak
User avatar

Joined: Thu Feb 28, 2008 9:09 pm
Posts: 53
Please check your categories and products titles there must be some special character causing problem. You can also call out the script directly which will provide with pure xml output you can zip and send it I might be able to help you.

http://yourdomain.com/admin/get_categories.php

_________________
Ecommerce Solution Provider
Ecommerce, CRE Loaded, Customization
Get your CRE Loaded store done today. Data Entry, Ebay and Amazon Inventory Management


Top
 Profile  
 
 Post subject: Re: Error type: LoadXML Description: Incorrect XML
PostPosted: Fri Mar 12, 2010 8:59 pm 
Offline
CRE Freak

Joined: Thu Jun 25, 2009 6:58 am
Posts: 50
I get the following error when I run /admin/get_categories.php


XML Parsing Error: not well-formed
Location: /admin/get_categories.php
Line Number 555, Column 26:<item text="4" Wakemaker (Natural Pearl Red Throat)" id="p_100235" im0="leaf.gif" im1="leaf.gif" im2="leaf.gif"></item>
-------------------------^


Top
 Profile  
 
 Post subject: Re: Error type: LoadXML Description: Incorrect XML
PostPosted: Fri Mar 12, 2010 10:31 pm 
Offline
CRE Freak

Joined: Thu Jun 25, 2009 6:58 am
Posts: 50
Well it seems there are hundreds if not thousands of products the have a quote " in them to show inch. I guess i need to edit them.


Top
 Profile  
 
 Post subject: Re: Error type: LoadXML Description: Incorrect XML
PostPosted: Tue Mar 16, 2010 5:24 am 
Offline
CRE Talented

Joined: Sun Nov 29, 2009 10:57 am
Posts: 348
You can try this, rather than renaming all your products..

In get_categories.php, look for the function str_rep($row){
, rename it to function str_rep1($row){

Paste the following code just above this function.
Code:
function str_rep($row, $quote_style = ENT_QUOTES, $charset = 'UTF-8')
{
    if (is_array($row)) {
        foreach($row as $key => $value) {
            $row[$key] = htmlspecialchars_deep($value, $quote_style, $charset);
        }
    } elseif (is_string($row)) {
        $row = htmlspecialchars(htmlspecialchars_decode($row, $quote_style), $quote_style, $charset);
    }
    return $row;
}


so you end up with :

Code:
function str_rep($row, $quote_style = ENT_QUOTES, $charset = 'UTF-8')
{
    if (is_array($row)) {
        foreach($row as $key => $value) {
            $row[$key] = htmlspecialchars_deep($value, $quote_style, $charset);
        }
    } elseif (is_string($row)) {
        $row = htmlspecialchars(htmlspecialchars_decode($row, $quote_style), $quote_style, $charset);
    }
    return $row;
}
  function str_rep1($row){
    $row = str_replace('&amp;', '&', $row);
    $row = str_replace('&', '&amp;', $row);
    $row = str_replace('>', '&gt;', $row);
    $row = str_replace('<', '&lt;', $row);
    return $row;
  }


This will allow the XML to complete, on removing the WHOLE product name where there is a special character it cant replace.

eg.. Product name = Penne á Candela Pasta from Naples 500g returns an empty product name because of the á
So, I ran the get_categories.php, with the replacement function str_rep, went through it, noting all products without a product name, just id.
eg..<item text="" id="p_6102" im0="leaf.gif" im1="leaf.gif" im2="leaf.gif"/>
then looked to find the offending character, replacing it using the following function, as I believe, the only replacement that takes place using the original function, is the last one in the order, so I ended up with the following.

Code:
function str_rep1($row, $quote_style = ENT_QUOTES, $charset = 'UTF-8')
{
    if (is_array($row)) {
        foreach($row as $key => $value) {
            $row[$key] = htmlspecialchars_deep($value, $quote_style, $charset);
        }
    } elseif (is_string($row)) {
        $row = htmlspecialchars(htmlspecialchars_decode($row, $quote_style), $quote_style, $charset);
    }
    return $row;
}
  function str_rep($row){

$spec_cs = array('ú', 'î', 'á', 'é', '£'); // These are the only Special Characters I needed to replace!!
$specialarray=array('&#250;', '&#237;', '&#225;', '&#233;', '&#163;');
$row1 = str_replace($spec_cs, $specialarray, $row);

    $row = str_rep1($row1);
    return $row;




Hope this helps..

_________________
CSS Store - http://mdjl40.mdjl-demo.co.uk -Work in Progress
YMM Filter Lists - http://mdjl-demo.co.uk/6-4-1a -Pagnation/Filter Lists


Top
 Profile  
 
 Post subject: Re: Error type: LoadXML Description: Incorrect XML
PostPosted: Wed Mar 17, 2010 7:02 pm 
Offline
CRE Freak
User avatar

Joined: Thu Feb 28, 2008 9:09 pm
Posts: 53
This works most of the time try it

line no 10 replace the encoding to utf16

Code:
echo '<?xml version="1.0" encoding="UTF-16"?>' . "\n";


replace the function:

Code:
  function str_rep($row){
    $row = str_replace('&amp;', '&', $row);
    $row = str_replace('&', '&amp;', $row);
    $row = str_replace('>', '&gt;', $row);
    $row = str_replace('<', '&lt;', $row);
   $row = str_replace('"', '&quot;', $row);
   $row = str_replace("'", " ", $row);
   $row = str_replace("/", " ", $row);
   $row = str_replace("£", "&#0163", $row);
    return $row;
  }

_________________
Ecommerce Solution Provider
Ecommerce, CRE Loaded, Customization
Get your CRE Loaded store done today. Data Entry, Ebay and Amazon Inventory Management


Top
 Profile  
 
 Post subject: Re: Error type: LoadXML Description: Incorrect XML
PostPosted: Wed Mar 24, 2010 11:30 am 
Offline
CRE Freak

Joined: Thu Jun 25, 2009 6:58 am
Posts: 50
TheLango wrote:
You can try this, rather than renaming all your products..

In get_categories.php, look for the function str_rep($row){
, rename it to function str_rep1($row){

Paste the following code just above this function.
Code:
function str_rep($row, $quote_style = ENT_QUOTES, $charset = 'UTF-8')
{
    if (is_array($row)) {
        foreach($row as $key => $value) {
            $row[$key] = htmlspecialchars_deep($value, $quote_style, $charset);
        }
    } elseif (is_string($row)) {
        $row = htmlspecialchars(htmlspecialchars_decode($row, $quote_style), $quote_style, $charset);
    }
    return $row;
}


so you end up with :

Code:
function str_rep($row, $quote_style = ENT_QUOTES, $charset = 'UTF-8')
{
    if (is_array($row)) {
        foreach($row as $key => $value) {
            $row[$key] = htmlspecialchars_deep($value, $quote_style, $charset);
        }
    } elseif (is_string($row)) {
        $row = htmlspecialchars(htmlspecialchars_decode($row, $quote_style), $quote_style, $charset);
    }
    return $row;
}
  function str_rep1($row){
    $row = str_replace('&amp;', '&', $row);
    $row = str_replace('&', '&amp;', $row);
    $row = str_replace('>', '&gt;', $row);
    $row = str_replace('<', '&lt;', $row);
    return $row;
  }


This will allow the XML to complete, on removing the WHOLE product name where there is a special character it cant replace.

eg.. Product name = Penne á Candela Pasta from Naples 500g returns an empty product name because of the á
So, I ran the get_categories.php, with the replacement function str_rep, went through it, noting all products without a product name, just id.
eg..<item text="" id="p_6102" im0="leaf.gif" im1="leaf.gif" im2="leaf.gif"/>
then looked to find the offending character, replacing it using the following function, as I believe, the only replacement that takes place using the original function, is the last one in the order, so I ended up with the following.

Code:
function str_rep1($row, $quote_style = ENT_QUOTES, $charset = 'UTF-8')
{
    if (is_array($row)) {
        foreach($row as $key => $value) {
            $row[$key] = htmlspecialchars_deep($value, $quote_style, $charset);
        }
    } elseif (is_string($row)) {
        $row = htmlspecialchars(htmlspecialchars_decode($row, $quote_style), $quote_style, $charset);
    }
    return $row;
}
  function str_rep($row){

$spec_cs = array('ú', 'î', 'á', 'é', '£'); // These are the only Special Characters I needed to replace!!
$specialarray=array('&#250;', '&#237;', '&#225;', '&#233;', '&#163;');
$row1 = str_replace($spec_cs, $specialarray, $row);

    $row = str_rep1($row1);
    return $row;




Hope this helps..



Thanks, I followed the above instructions and it works fine. I did try your last suggestion replacing the function, but all I get is a blank page. Thanks for the help.


Top
 Profile  
 
 Post subject: Re: Error type: LoadXML Description: Incorrect XML
PostPosted: Wed Mar 24, 2010 2:28 pm 
Offline
CRE Talented

Joined: Sun Nov 29, 2009 10:57 am
Posts: 348
NatTack wrote:
Thanks, I followed the above instructions and it works fine. I did try your last suggestion replacing the function, but all I get is a blank page. Thanks for the help.


Apologies, I missed the bottom of the code off.. should have read..

Code:
function str_rep1($row, $quote_style = ENT_QUOTES, $charset = 'UTF-8')
{
    if (is_array($row)) {
        foreach($row as $key => $value) {
            $row[$key] = htmlspecialchars_deep($value, $quote_style, $charset);
        }
    } elseif (is_string($row)) {
        $row = htmlspecialchars(htmlspecialchars_decode($row, $quote_style), $quote_style, $charset);
    }
    return $row;
}
  function str_rep($row){

$vowels = array('ú', 'í', 'á', 'é', '£');
$myarray=array('&#250;', '&#237;', '&#225;', '&#233;', '&#163;');
$row1 = str_replace($vowels, $myarray, $row);


    $row = str_rep1($row1);


    return $row;
  }


_________________
CSS Store - http://mdjl40.mdjl-demo.co.uk -Work in Progress
YMM Filter Lists - http://mdjl-demo.co.uk/6-4-1a -Pagnation/Filter Lists


Top
 Profile  
 
 Post subject: Re: Error type: LoadXML Description: Incorrect XML
PostPosted: Thu Mar 25, 2010 6:07 am 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2211
Location: New Zealand
That's great - thanks TL (another error fixed!)
Simon

TheLango wrote:
NatTack wrote:
Thanks, I followed the above instructions and it works fine. I did try your last suggestion replacing the function, but all I get is a blank page. Thanks for the help.


Apologies, I missed the bottom of the code off.. should have read..

Code:
function str_rep1($row, $quote_style = ENT_QUOTES, $charset = 'UTF-8')
{
    if (is_array($row)) {
        foreach($row as $key => $value) {
            $row[$key] = htmlspecialchars_deep($value, $quote_style, $charset);
        }
    } elseif (is_string($row)) {
        $row = htmlspecialchars(htmlspecialchars_decode($row, $quote_style), $quote_style, $charset);
    }
    return $row;
}
  function str_rep($row){

$vowels = array('ú', 'í', 'á', 'é', '£');
$myarray=array('&#250;', '&#237;', '&#225;', '&#233;', '&#163;');
$row1 = str_replace($vowels, $myarray, $row);


    $row = str_rep1($row1);


    return $row;
  }


_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

Board index » CRE Loaded Support » CRE Loaded 6.4

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
It is currently Wed Feb 08, 2012 8:17 am
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Login

Top Listing

1. Cart2Cart - Shopping...
    Category: Shopping Cart Database Conversion Scripts
    
2. Points & Rewards PLUS!...
    Category: Add-Ons
    
3. Configuration Server...
    Category: Fixes
    
4. Credit Card with CCV
    Category: Payment Modules
    
5. CC7333_ATS
    Category: Templates
    
Show more...

Follow Us on Twitter

An error occurred

Oops, an error seems to have occurred. We're sorry for any inconvenience this might have caused. If the error persists, feel free to tell us about it.

CRE Loaded Community Chat hosted by CRE Loaded.

Join now


Chat about what's on your mind. More about public chats.


© CRE Loaded is a product of Chain Reaction Ecommerce, Inc. Usage & Privacy Policy