hello,
I am new to xml and I am building a mobile app in Flash Builder 4.6 that tracks stock prices on the global markets. I am accessing a table from yahoo.finance called stocks which is user created table (not by me). The problem is company name for the stock in question is always NULL though this was not the case a couple of months ago.

Can anybody determine in the following code, what may be the error?

<table><meta><author>######</author>
<description>Yahoo Finance Stock Summary Information</description><sampleQuery>select * from {table} where symbol="yhoo"</sampleQuery></meta>

<bindings>
<select itemPath="" produces="XML">
<urls><url/></urls>
<inputs>
<key id="symbol" type="xs:string" paramType="variable" required="true"/></inputs>
<execute>

// pad string with leading char
String.prototype.pad = function (padchar, padlen) {
s = this
while (s.length < padlen) {
s = padchar + s;
}
return s;
}

String.prototype.trim = function () {
var str = this.replace(/^\s\s*/, ''),
ws = /\s/,
i = str.length;
while (ws.test(str.charAt(--i)));
return str.slice(0, i + 1);
}

function getQuoteInfo() {
// Get company name & market from Yahoo Quotes Summary page
var results = quoteQuery.results;
elements = results.*.length();
if (elements == 0)
return false;

stock.CompanyName = results.h1.text().toString().trim();
var marketSymbolStr = results.div.span.toString();
//var match = marketSymbolStr.match(/^[^:]+:\s+([^)]+)\)$/); matches stock symbol
var match = marketSymbolStr.match(/^\(([^:]+):/);
if (match != null) {
stock.CompanyName += <Market>{match[1]}</Market>;

}
return true;
}

function getHistoricalPrice() {
// Get the Historical Price Range
var results = historicalQuery.results;
elements = results.*.length();
if (elements < 6)
return false;
startMonth = String(parseInt(results.option[0].@value)+1).pad("0", 2);
startDay = results.input[0].@value.toString().pad("0", 2);
startYear = results.input[1].@value.toString();
endMonth = String(parseInt(results.option[1].@value)+1).pad("0", 2);
endDay = results.input[2].@value.toString().pad("0", 2);
endYear = results.input[3].@value.toString();

startDate = startYear + "-" + startMonth + "-" + startDay;
endDate = endYear + "-" + endMonth + "-" + endDay;

stock.appendChild(<start>{startDate}</start>);
stock.appendChild(<end>{endDate}</end>);
return true;
}

function getProfileInfo() {
// Get the Sector, Industry, Full Time Employees from Profile page
var results = profileQuery.results;
elements = results.*.length();
if (elements == 0)
return false;
for each (var tr in results.tr){
//Remove trailing colon, and strip whitespace
var property = tr.td[0].p.text()
.toString().slice(0, -1)
.replace(/\s+/g, "");
switch (property.toLowerCase()) {
case 'indexmembership':
continue;
break;
case 'fulltimeemployees':
//Strip commas
value = tr.td[1].*.text().toString().replace(/,/g, "");
break;
default:
//Convert whitespace to single space
value = tr.td[1].*.text().toString().replace(/\s+/g, " ");
break;
}
stock.appendChild(<{property}>{value}</{property}>);
}
return true;
}

// Queue the queries
var url = "http://finance.yahoo.com/q/pr?s="+symbol;
var profileQuery = y.query(
"select * from html " +
"where url=@url and " +
"xpath='//table[@class=\"yfnc_datamodoutline1\"]/tr/td/table/tr' " +
"limit 4",
{url:url});

var url = "http://finance.yahoo.com/q?s="+symbol;
var quoteQuery = y.query(
"select * from html " +
"where url=@url and " +
"xpath='" +
"//div[@id=\"yfi_investing_head\"]/h1 | " +
"//div[@class=\"yfi_quote_summary\"]/div[1]'" ,
{url:url});

var url = "http://finance.yahoo.com/q/hp?s="+symbol;
var historicalQuery = y.query(
"select * from html " +
"where url=@url and " +
"xpath='" +
"//option[@selected=\"selected\"] | " +
"//input[@maxlength=\"2\"] | " +
"//input[@maxlength=\"4\"]'",
{url:url});

var stock = <stock symbol={symbol}></stock>;

getQuoteInfo();
getHistoricalPrice();
getProfileInfo();

response.object = stock

</execute></select></bindings></table>