public boolean parseAsProducts(InputStream xmlStream) {
boolean status = false;
try {
Document doc = _docBuilder.parse(xmlStream);
XPath xpath = XPathFactory.newInstance().newXPath();
MobcomProperties props = MobcomProperties.getInstance();
Node validNode = (Node) xpath.evaluate(props.get("XPATH_VALID"), doc,
XPathConstants.NODE);
if(validNode != null)
System.out.println(validNode.getTextContent());
if(validNode == null || validNode.getTextContent().equals("False"))
{
Node message = (Node) xpath.evaluate(props.get("XPATH_ERRORMESSAGE"),
doc,
XPathConstants.NODE);
System.out.println("Invalid xml response. " + message.getTextContent());
return status;
}
NodeList asinList = (NodeList) xpath.evaluate(props.get("XPATH_ASIN"),
doc, XPathConstants.NODESET);
NodeList smallImages = (NodeList) xpath.evaluate(props.get("XPATH_SMALL_IMAGES"),
doc, XPathConstants.NODESET);
if(asinList == null || smallImages == null)
{
System.out.println("Null");