Trying to modify code that I inherited. I'm an xml/xsl/sql person and this just has me stumped.
xml data behind a form containing customer information. I need to get the value from a field id two nodes down.
Purpose is to pull the value out and incorporate it into a query string to pass through to a URL. I can't pull it using SelectSingleNode.
This is the code that's in the current file. Need to get city out of code above instead of the App Key / ID Number.
Help please? Thanks!
xml data behind a form containing customer information. I need to get the value from a field id two nodes down.
Code:
<pagexml>
<webSessionXML>
<TransportData>
<Field Id="CUST.CITY" Value="New Orleans" UIRequired="0" UIDisabled="0" UIHidden="0" UpdatedBy="User"/>
Purpose is to pull the value out and incorporate it into a query string to pass through to a URL. I can't pull it using SelectSingleNode.
This is the code that's in the current file. Need to get city out of code above instead of the App Key / ID Number.
Code:
var application_number = '';
var key = null;
var type = '';
var keynode = opener.pageXML.documentElement.selectSingleNode('//AppKey');
var key = '';
if(keynode){
key=keynode.text;
}
if(key.length > 0){
type = 'APPLICATIONDATA_IDNUMBER';
application_number = key;
}else{
type = 'APPLICATIONDATA_OTHERNUMBER';
try{
application_number = $('body', opener.document).html().match(/"OTH_KEY" [vV]alue\="([\d\.\d]+)"/)[1];
}catch(e){
}
if(typeof application_number === 'undefined' || application_number == ''){
application_number = $("input[onchange*=updateOtherKeyValue]", opener.document).val();
}
}
window.location = '[URL unfurl="true"]http://thatcompanysurl.com/ourfolder/ourSystem/show/SummaryFlowA?auth_token=ourtokencode&query="'[/URL] + type + '":"' + application_number + '"';
Help please? Thanks!