Scodigo, Inc.

Log In | Register

Cart Items:
0

XmlHTTP

User icon

The reason I am asking is I have a Amazon web services rest request. The result comes back in XML styled with an XSL style sheet I think. In any case, I am able to get the element text for the product items I want using simplexml_load_string(). The problem is capturing the error code message. When there is an error the format of the XML returned changes and I can't get the element text using simplexml_load_string. For some reason I can't access the node to get the text I think becuase of the way it is formed. I am thinking of using Xpath but my understanding of Xpath is you need Javascript? Can I add that on the php page in Flemaker? If not, I can just do a hack to get the error message using regular expressions but it brought up the issue. CAn Smart Pill handle xpath or xmlHTTP? I'm new to Xpath so I thought I'd ask before I get into it if I can do it with the plug-in

XmlHTTP

Micah Woods's picture

Hello Janis,

There's an XPath example in the Testbed.fp7 file that's included with the SmartPill download.

You also might take a look at SimpleXMLElement::attributes here:

http://www.php.net/manual/en/simplexmlelement.attributes.php

There's an example in the notes at the bottom of the page that shows how to get an attribute value. I'm not sure that's the issue you're having but it may help.

Regards,
Micah