SiteExperts.com Logo Home | Community | Developer's Paradise
User Groups | Site Tools | Site Information | Search
 Main Menu
 Forums
SiteExperts.com Forums
All Discussions

SiteExperts Feedback
The Lounge
Dynamic HTML
Site Design/ Critiques
HTML and CSS
XML Technologies
The Wireless Internet
Internet Explorer
Microsoft .NET
The Server
Technical Support

Sponsored Links

User Groups : Forums : SiteExperts : XML Technologies :

Previous DiscussionNext Discussion
 selectNodes issue/question

Set NodeList = objXMLDoc.selectNodes("/MarketingList/TargetClient/FNAME | LNAME")

is this proper syntax? I'm trying to grab both "FNAME" and "LNAME" nodes and combine them into one value with no space in between. Make sense?

thanks for ANY help!

Started By danthewebguy on Aug 10, 2005 at 12:24:36 PM

24 Response(s) | Reply

Earlier Replies | Replies 11 to 17 of 24 | Later Replies
Goto Page: 4 3 2 1
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

Earlier Replies | Replies 11 to 17 of 24 | Later Replies
Goto Page: 4 3 2 1

To respond to a discussion, you must first logon.

If you are not registered, please register yourself to become a member of the SiteExperts.community.

User Name
Password
Copyright 1997-2004 InsideDHTML.com, LLC. All rights reserved.