Please Help! Error: Code = -1?

32 views
Skip to first unread message

Petrogad

unread,
Sep 20, 2011, 10:01:21 AM9/20/11
to PHRETS
I've been getting this error a bit now with a new stream I'm trying:
-
ERROR: Array
(
[type] => xml
[code] => -1
[text] => XML parsing error: <RETS ReplyCode="0"
ReplyText="Operation Successful">
<COUNT Records="748698" />
<DELIMITER value="09" />
<COLUMNS> *the columns in my data*</COLUMNS>
<DATA> *my data*</DATA>
<MAXROWS />
<RETS-STATUS ReplyCode="0" ReplyText="Operation Successful" />
</RETS>

any idea on what exactly is going on here or how to solve this?

Please help

Petrogad

unread,
Sep 20, 2011, 10:08:15 AM9/20/11
to PHRETS
Just an update; this is when i'm doing a search and have paged through
about 28k records, then all of a sudden i get this.
Message has been deleted

Petrogad

unread,
Sep 20, 2011, 10:43:49 AM9/20/11
to PHRETS
I fixed this; I found that the data had the following character in
it:

Western hills<perfect for

which was making it look like an extra tag. I've hard coded a fix,
however would really like to see a better option which allows me to
just check the data not all xml as a overall clean on the item: <
didn't work. Please let me know

To fix it in the fix_encoding method I changed it to be the
following:


private function fix_encoding($in_str) {
if ($this->disable_encoding_fix == true) {
return $in_str;
}
$pattern = array();
$pattern[0] = '/\&\s/';
$pattern[1] = '/ills<perfect/';
$replacement = array();
$replacement[0] = '&amp; ';
$replacement[1] = '&lt;';
$in_str = preg_replace($pattern, $replacement,
$in_str);
$cur_encoding = mb_detect_encoding($in_str);
if ($cur_encoding == "UTF-8" &&
mb_check_encoding($in_str, "UTF-8"))
{
return $in_str;
}
else {
return utf8_encode($in_str);
}
}
instead of:
private function fix_encoding($in_str) {
if ($this->disable_encoding_fix == true) {
return $in_str;
}
$in_str = preg_replace($/\&\s/, $&amp; , $in_str);
$cur_encoding = mb_detect_encoding($in_str);
if ($cur_encoding == "UTF-8" &&
mb_check_encoding($in_str, "UTF-8"))
{
return $in_str;
}
else {
return utf8_encode($in_str);
}
}
'

Troy Davisson

unread,
Sep 20, 2011, 1:04:22 PM9/20/11
to phr...@googlegroups.com
A server that provides a plain less-than sign within the content of one of it's fields is not RETS compliant in it's behavior.  I'm not clear on what you'd like to see as a better solution on the client-side.  RETS is an XML-based transport protocol and uses less-than and greater-than signs as part of the tags it has.

I'm all about making PHRETS "just work", but this kind of automated detection and fix could get pretty in-depth.  If you could think of something that could be enabled by using a special SetParam() call, that might be the best way to do it.


--
You received this message because you are subscribed to the Google Groups "PHRETS" group.
To post to this group, send email to phr...@googlegroups.com.
To unsubscribe from this group, send email to phrets+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/phrets?hl=en.


Petrogad

unread,
Sep 21, 2011, 9:01:56 AM9/21/11
to PHRETS
Yea; I've notified the rets board that it's an not in compliance item;
however from working with over 20 boards there is always something
goofy that they deem to place in the feeds.

For now I'll enable the setparam call, but yea; would really like not
to have to add in special cases for detection.

Thanks!

Petrogad

unread,
Sep 21, 2011, 9:25:24 AM9/21/11
to PHRETS
Yea; I've notified the rets board that it's an not in compliance item;
however from working with over 20 boards there is always something
goofy that they deem to place in the feeds.

For now I'll enable the setparam call, but yea; would really like not
to have to add in special cases for detection.

Thanks!

On Sep 20, 12:04 pm, Troy Davisson <troy.davis...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages