View Single Post
  #4 (permalink)  
Old November 29th, 2007, 06:28 AM
Hughesie78 Hughesie78 is offline
Authorized User
 
Join Date: Nov 2007
Location: , , Ireland.
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Hughesie78
Default

Hey , ive removed the single quotes from around the concat, thanks, I am still receining this error thou:

'//bank[text() = concat('', 'Clears through Bank name’)] and ..branch[text()= concat('', 'london uk')] ' has an invalid token.

Here is the code now:
XmlNodeList codelist = bankdoc.SelectNodes("//bank[text() = " + GetXPathString(strBank) + "] & ..branch[text()= " + GetXPathString(strBranch) + "] ");
Also have tried
XmlNodeList codelist = bankdoc.SelectNodes("//bank[text() = " + GetXPathString(strBank) + "] and ..branch[text()= " + GetXPathString(strBranch) + "] ");


When Split this code i.ie
XmlNodeList codelist = bankdoc.SelectNodes("//bank[text()= " + GetXPathString(strBank) + "] ");
OR
XmlNodeList codelist = bankdoc.SelectNodes("//branch[text()= " + GetXPathString(strBranch) + "] ");
It works fine, it ojnly gives me the erroer when I want to query 2 nodes, so i must doing something wrong in the ‘AND’ part , any ideas, im lost.
Here is my XML:

basically I am trying to select the <nsc> element, from the values of 2 drop down menus, the first selects <bank> (it’s a distinct list of banks) and the seconds selects <branch> and list of all branchs for the bank selected , I want to print the <nsc> value to a text box.

  <Bank>
    <nsc>000000</nsc>
    <bank>Clears through bank name</bank>
    <branch>london uk</branch>
    <address1>The Square</address1>
    <address2> </address2>
    <address3> </address3>
    <keywords> </keywords>
    <telephone></telephone>
    <fax></fax>
    <atm>Yes</atm>
  </Bank>

Hope this makes sense
Reply With Quote