"Price Spectre"
 All Data Structures Functions Pages
XMLDocument Class Reference
+ Inheritance diagram for XMLDocument:
+ Collaboration diagram for XMLDocument:

Public Member Functions

 __construct ($str)
 toString ()
- Public Member Functions inherited from XMLNode
 getChildNodes ()
 getElements ($name)
 getElement ($name)
 getName ()
 getValue ()

Detailed Description

A class that represents an XML document.

Constructor & Destructor Documentation

__construct (   $str)

Creates the XMLDocument.

// fetch UPC from keywords
var upc = ps.getSearchParameter('keywords');
// create request XML
var xmlStr = "<?xml version='1.0'?>"
+ '<findItemsByProductRequest xmlns="http://www.ebay.com/marketplace/search/v1/services">'
+ "<productId type=\"UPC\">" + upc + "</productId>"
+ "<sortOrder>PricePlusShippingLowest</sortOrder>"
+ "</findItemsByProductRequest>";
// Create an XMLDocument object from the above string.
var xmlRequest = new XMLDocument(xmlStr);

Member Function Documentation

toString ( )

Returns a string representing the XMLDocument.

A string representing the XMLDocument.
// copy XML request as requestCopy
var requestCopy = new XMLDocument(request.toString());