List Info

Thread: Re: Make it stop!




Re: Make it stop!
country flaguser name
United States
2007-03-03 03:28:20
Trouble is that it's PHP-5 dependent.  If it were available
on php-4 I'd
probably be all over it!

My test server is php-4 and my production php-5.  Hence I
get a look at
my portability between the two as part of my development
process.

Tony
www.ez-order-manager.com 

-----Original Message-----
From: google-checkout-api-integrationgooglegroups.com
[mailto:google-checkout-api-integrationgooglegroups.com] On Behalf Of
Robin K
Sent: Saturday, March 03, 2007 12:51 AM
To: google-checkout-api-integrationgooglegroups.com
Subject: [google-checkout-api-integration] Re: Make it
stop!


tony, have you tried using "simplexml" .. i
absolutely love it ?

----- Original Message -----
From: "GoogleCheckoutDevPro"
<checkout-dev-progoogle.com>
To: "Google Checkout Developers Forum - API Integration
Basics" 
<google-checkout-api-integrationgooglegroups.com>
Sent: Saturday, March 03, 2007 1:45 AM
Subject: [google-checkout-api-integration] Re: Make it
stop!


>
> Hi Tony,
>
> Could you try specifying the option
'XML_OPTION_SKIP_WHITE' in the
> XmlParser function as shown below?
>
>    function XmlParser($input) {
>      $xmlp = xml_parser_create();
>      xml_parser_set_option($xmlp,
XML_OPTION_SKIP_WHITE, 0 );
>      xml_parse_into_struct($xmlp, $input, $vals,
$index);
>      xml_parser_free($xmlp);
>      $this->root = strtolower($vals[0]['tag']);
>      $this->params =
$this->UpdateRecursive($vals);
>    }
>
> 'XML_OPTION_SKIP_WHITE' is set to 0 by default, but
when it's changed
> to 1, it skipped <MeterNumber> as you observed.
Thus, I would think
> that it should be explicitly set to 0.
>
> Please let me know if this doesn't help.
>
> Thanks,
> Jacob
>
> On Mar 1, 2:43 pm, "Tony Birnseth"
<t...1sit.com> wrote:
>> UPDATE: Found the difference in the two samples
below...  If Sample 1
is
>> run with NO WHITESPACE in the string (and not
newline terminated) it
>> also skips the MeterNumber element!  I have no idea
why, but there's
>> definitely a bug here!
>>
>> Please have someone familiar with this code take a
look.  Seems the
>> reason you couldn't reproduce is because I had
formatted the xml for
>> you.
>>
>> Below is other info...
>>
>> tony
>>
>> Okay, found the revision with the params=array() in
a branch (not
>> trunk).  But it doesn't have the change related to
the isset().  When
I
>> run the XML response below against the parser, I
get:
>> Notice: Undefined index: value in
>>
/var/www/html/ezomTest/om/classes/GoogleCheckout/library/xml
-processing/
>> xmlparser.php on line 102
>>
>> 4 instances of this error (when run within the
application) and 2
when
>> run with just the string being shoved to XmlParser.
 When I add the
>> isset() change I don't get the error.
>>
>> Sample 1:  Running this small script does indeed
show the MeterNumber
>> tag (but has the errors for undefined index
'value').  Have no idea
why
>> these should be ANY different at all.  Both include
my fedEx.php
class
>> and that's where the xmlparser.php is included
from!
>>
>> Sample 2: The exact same code running in my class,
using the exact
same
>> parser, etc. does not Have the MeterNumber $data
index and generates
4
>> instances of the undefined index error.
>>
>> Sample 1 (result and parsed $data array):
>>
>> $xml_string = '<?xml version="1.0"
encoding="UTF-8"?>
>> <FDXSubscriptionReply
>> xmlnssi=&q
uot;http:
//www.w3.org/2001/XMLSchema-instance"
>>   
xsi:noNamespaceSchemaLocation="FDXSubscriptionReply.xsd
">
>>   <ReplyHeader>
>>     <CustomerTransactionIdentifier>
>>       Meter Request
>>     </CustomerTransactionIdentifier>
>>   </ReplyHeader>
>>   <MeterNumber>1178654</MeterNumber>
>>   <SubscribedService>FedEx Express
Shipping</SubscribedService>
>>   <SubscribedService>FedEx Ground
Shipping</SubscribedService>
>> </FDXSubscriptionReply>
>> ';
>>
>> $parser = new XmlParser($xml_string);
>> $root = $parser->GetRoot();
>> $data = $parser->GetData();
>> echo '<pre>';
>> echo 'root='.$root."n";
>> echo 'data:'."n";
>> print_r($data);
>> echo '</pre>';
>>
>> Notice: Undefined index: value in
>>
/var/www/html/ezomTest/om/classes/GoogleCheckout/library/xml
-processing/
>> xmlparser.php on line 102
>>
>> Notice: Undefined index: value in
>>
/var/www/html/ezomTest/om/classes/GoogleCheckout/library/xml
-processing/
>> xmlparser.php on line 102
>>
>> root=fdxsubscriptionreply
>> data:
>> Array
>> (
>>     [fdxsubscriptionreply] => Array
>>         (
>>             [xmlnssi]
=>http://www.
w3.org/2001/XMLSchema-instance
>>             [xsi:nonamespaceschemalocation] =>
FDXSubscriptionReply.xsd
>>             [replyheader] => Array
>>                 (
>>                     [customertransactionidentifier]
=> Array
>>                         (
>>                             [VALUE] => Meter
Request
>>                         )
>>
>>                 )
>>
>>             [meternumber] => Array
>>                 (
>>                     [VALUE] => 1178654
>>                 )
>>
>>             [subscribedservice] => Array
>>                 (
>>                     [0] => Array
>>                         (
>>                             [VALUE] => FedEx
Express Shipping
>>                         )
>>
>>                     [1] => Array
>>                         (
>>                             [VALUE] => FedEx
Ground Shipping
>>                         )
>>
>>                 )
>>
>>         )
>>
>> )
>>
>> Sample 2 (code from my class and results):
>>
>>                 $parser = new
XmlParser($xml_result);
>>                 $root = $parser->GetRoot();
>>                 $data = $parser->GetData();
>>
dbg("xmlResult=".htmlspecialchars($xml_result));
>> dbg("root=".$root);
>> dbg("data:".pr($data));
>>
>> Sample 2 Results:
>>
>> Notice: Undefined index: value in
>>
/var/www/html/ezomTest/om/classes/GoogleCheckout/library/xml
-processing/
>> xmlparser.php on line 102
>>
>> Notice: Undefined index: value in
>>
/var/www/html/ezomTest/om/classes/GoogleCheckout/library/xml
-processing/
>> xmlparser.php on line 102
>>
>> Notice: Undefined index: value in
>>
/var/www/html/ezomTest/om/classes/GoogleCheckout/library/xml
-processing/
>> xmlparser.php on line 102
>>
>> Notice: Undefined index: value in
>>
/var/www/html/ezomTest/om/classes/GoogleCheckout/library/xml
-processing/
>> xmlparser.php on line 102
>>
>> xmlResult=<?xml version="1.0"
encoding="UTF-8"?>
>> <FDXSubscriptionReply
>> xmlnssi=&q
uot;http:
//www.w3.org/2001/XMLSchema-instance"
>>    
xsi:noNamespaceSchemaLocation="FDXSubscriptionReply.xsd
">
>>   <ReplyHeader>
>>     <CustomerTransactionIdentifier>
>>       Meter Request
>>     </CustomerTransactionIdentifier>
>>   </ReplyHeader>
>>   <MeterNumber>1178663</MeterNumber>
>>   <SubscribedService>FedEx Express
Shipping</SubscribedService>
>>   <SubscribedService>FedEx Ground
Shipping</SubscribedService>
>> </FDXSubscriptionReply>
>>
>> root=fdxsubscriptionreply
>>
>> data:Array
>> (
>>     [fdxsubscriptionreply] => Array
>>         (
>>             [xmlnssi]
=>http://www.
w3.org/2001/XMLSchema-instance
>>             [xsi:nonamespaceschemalocation] =>
FDXSubscriptionReply.xsd
>>             [replyheader] => Array
>>                 (
>>                     [customertransactionidentifier]
=> Array
>>                         (
>>                             [VALUE] => Meter
Request
>>                         )
>>
>>                 )
>>
>>             [subscribedservice] => Array
>>                 (
>>                     [0] => Array
>>                         (
>>                             [VALUE] => FedEx
Express Shipping
>>                         )
>>
>>                     [1] => Array
>>                         (
>>                             [VALUE] => FedEx
Ground Shipping
>>                         )
>>
>>                 )
>>
>>         )
>>
>> )
>
>
> > 






--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "API Integration Basics" group.
To post to this group, send email to
google-checkout-api-integrationgooglegroups.com
To unsubscribe from this group, send email to
google-checkout-api-integration-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/google-checko
ut-api-integration?hl=en
-~----------~----~----~----~------~----~------~--~---


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )