BachusII on Aug 11, 2005 at 8:13:49 AM (# 11) This message has been edited.Ah no. Your query selects all existing FNAMEs and LNAMEs. And that for each loop concatenates all of them together. Not a bad thing as such because you could check whether s contains the value from sSourcePage. It would be easier if you would select the single /MarketingList/TargetClient where FNAME & LNAME are equal to sSourcePage. In XPATH that would be
/MarketingList/TargetClient[ concat( FNAME, LNAME ) = /* insert sSourcePage here */ ] (If the return value is null, it means no match.) danthewebguy on Aug 11, 2005 at 8:20:34 AM (# 12)so . . .
Set NodeList = objXMLDoc.selectNodes("/MarketingList/TargetClient[ concat( FNAME, LNAME ) = "& sSourcePage &" ]")
s = ""
If s <> "" Then response.write "you are a user!" Else response.write "you are NOT a user!" End If BachusII on Aug 11, 2005 at 8:39:24 AM (# 13)Not quite. I'm fairly sure that the XPATH as I wrote it won't work in IE. And after selection NodeList either contains a single TargetClient node, or it is null. danthewebguy on Aug 11, 2005 at 8:44:27 AM (# 14)hell, I'm totally lost - I'm going to go hide under a rock I think! :) BachusII on Aug 11, 2005 at 8:53:09 AM (# 15)I would help (re)write the query, but I don't have IE handy so I can't test. What was VBScripts comment again? ' or something?
If NodeList <> NULL Then /* don't know offhand if that is the proper method to get null */ response.write "you are a user!" Else response.write "you are NOT a user!" End If danthewebguy on Aug 11, 2005 at 9:34:20 AM (# 16)that comes back at me with "Wrong number of arguments or invalid property assignment" in the browser . . . ChrisRickard on Aug 11, 2005 at 9:57:44 AM (# 17)selectNodes will always return a collection. If there are no matches the .Count will be 0. If NodeList.Count = 0 Then Response.Write "You are a user!" Else Response.Write "you are NOT a user!" End If
|