コード例 #1
0
ファイル: example.php プロジェクト: annggeel/tienda
**
** Let's start by fetching the partsRateReply element.
** Normally, you'd be verifying that the element was found
** but in order to keep this light and keep everybody from 
** getting into the habit of good error checking, I'll skip
** it.
**
** getElement() returns the first element with a matching name.
** if there are multiple elements with the same name, use one
** of the methods below.
*/
/* Note: the '=&' operator here is optional: since we won't
** be modifying the response it doesn't matter if we work on
** a copy.  
*/
$rateResp = $returnedXMLDoc->getElement('partsRateReply');
/* We can now use the rateResponse element to get access 
** to it's children.
*/
$status = $rateResp->getElement('status');
$statusMessage = $status->getElement('message');
print "<BR>Status message is " . $statusMessage->getValue() . "<BR>\n";
/* We can also access the elements by 'path' (if it is unique)
** To do so, use the getElementByPath method on an element.  The parameter
** is a path relative to this element (ie you may only access this element
** and any of it children/subchildren).
**
**
** Here we use the MiniXMLDoc object (thus the root element), so we pass
** the 'full path' as a parameter.
*/