function XML2Query(XML, XPath){ var xmldoc = xmlparse(arguments.XML); if (isdefined('arguments.XPath')) { topnodes = XMLSearch(xmldoc,arguments.xpath); } else { topnodes = xmldoc.XmlRoot.XmlChildren; } /* return empty query if there are no childnodes */ if (arraylen(topnodes) eq 0) { xquery = querynew('noresults'); return xquery; break; } currentelement = topnodes[1].XMLName; columns = currentelement; // get attribute names listofattributes = arraytolist(StructKeyArray(topnodes[1].XMLAttributes)); for (j = 1; j LTE listlen(listofattributes); j = j + 1) { attributename = currentelement & '_' & listgetat(listofattributes,j); if (listfindnocase(columns,attributename) eq 0) { columns = listappend(columns,attributename); } } // get child element names arrayofchildren = topnodes[1].XMLChildren; for (k = 1; k LTE arraylen(arrayofchildren); k = k + 1) { childname = currentelement & '_' & arrayofchildren[k].XMLName; if (listfindnocase(columns,childname) eq 0) { columns = listappend(columns,childname); } } // add rows to the recordset xquery = querynew(columns); for (i = 1; i LTE arraylen(topnodes); i = i + 1) { // first set the element value queryaddrow(xquery); currentelement = topnodes[i].XMLName; currentelementvalue = topnodes[i].XMLText; QuerySetCell(xquery, currentelement, currentelementvalue); // now all the attributes structofattributes = topnodes[i].XMLAttributes; for (j in structofattributes) { attributename = currentelement & '_' & j; if (listfindnocase(columns,attributename)) { QuerySetCell(xquery, attributename,structFind(structofattributes, j)); } } // now all the child elements (probably not necessary for rationalmedia) arrayofchildren = topnodes[i].XMLChildren; for (k = 1; k LTE arraylen(arrayofchildren);k = k + 1) { childname = currentelement & '_' & arrayofchildren[k].XMLName; if (listfindnocase(columns,childname)) QuerySetCell(xquery, childname,arrayofchildren[k].XMLText); } } return xquery; } SELECT * from TransporterList where RecId = #Url.RecId# SELECT * from TransporterList where ( Phone1 = '#Url.Phone1#' or Phone2 = '#Url.Phone1#' or mobilephone = '#Url.Phone1#') Add / Edit Transporter
CompanyName   CD.Find   R Contact  
Address     G.Dir   Ld List City/State/Zip        Z.fnd
W. Phone 1    SMS  Pvdr W. Phone 2    Pvdr
Fax No.    CD Email   Files   Files Cell Phone    SMS  Pvdr  SMS  Pvdr
EmailAddress   W. Phone 3  
WebAddress   Fed Tax Id  
US DOT No.      CA No.  ICC MC No    check DOT
Status:      Co. Type  Folder:    Create Folder
Trailer Type   Company CD Id:    #CompanyId#
Route  
1:#qReadTrsptrRecord.phone1# 2:#qReadTrsptrRecord.phone2# 3:#qReadTrsptrRecord.phone3# M:#qReadTrsptrRecord.Mobilephone#
Notes
 
References   \1","all")> #qReadTrsptrRecord.Business_Reference_1#
  \1","all")> #qReadTrsptrRecord.Business_Reference_2#
  \1","all")> #qReadTrsptrRecord.Business_Reference_3#

#Name# - #DateFormat(DATELASTMODIFIED,"mmm-dd-yy")# - #nDaysOld# old

No Cert on File

Ins. Co. NameFind   G.Find
Ins. City / State
Ins. Co.Phone:>   Find   411
Ins. Co. Fax :   Cert Req   Alt.CertReq
 #NumberFormat(LiabInsLimit,"$999,999,999")# / #NumberFormat(CargoInsLimit,"$999,999,999")# / #NumberFormat(InsDeductable,"$999,999,999")#
Years/Equiptment  Since: #YearEstablished# | #NumberOfTrucks# Truck(s), |  #EquipDescription#
                           
  Profile   Chg PhoneNo   Chg Co.Name