Solved

Quick XML Q...

Posted on 2008-10-21
4
240 Views
Last Modified: 2011-09-20
can someone tell me and correct what I am doing wrong here:
Set objNode = objXML.SelectSingleNode("//Event[@ID = '" & intEventID & "']//User[@FNAME = '"&trim(strFName)&"'][@LNAME = '"&trim(strLName)&"']")
                  objNode.Attributes.Item(5).text = "1"
Set objNode = Nothing


I'm trying to set PAID to = 1  (which happens to be the 0 based 5 attribute of the User node)

I've verified that strFName, strLName, and intEventID are correct, and I can in fact retrieve the data from the node like this, however I am trying to update an attribute, and it simply does not update.  No errors either
0
Comment
Question by:kevp75
  • 2
  • 2
4 Comments
 
LVL 9

Expert Comment

by:CCongdon
ID: 22769649
objNode is no longer a part of objXML. You need to re-integrate objNode into objXML. Easy way to do this is to delete the node from objXML and then append objNode back into the right spot in objXML if you need to do it the way you are showing... or...
objXML.SelectSingleNode("//Event[@ID = '" & intEventID & "']//User[@FNAME = '"&trim(strFName)&"'][@LNAME = '"&trim(strLName)&"']").Attributes.Item(5).text = "1"
 
0
 
LVL 25

Author Comment

by:kevp75
ID: 22769889
objXML.async = False
blnFileExist = objXML.load(xmlPath)
objXML.SelectSingleNode("//Event[@ID = '" & intEventID & "']//User[@FNAME = '"&trim(strFName)&"'][@LNAME = '"&trim(strLName)&"']").Attributes.Item(5).text = "1"


doesn't update either
0
 
LVL 9

Accepted Solution

by:
CCongdon earned 500 total points
ID: 22769997
Dont forget:
xmlDoc.Save(xmlPath)
Since you are just editing a file in memory, you do need to save it to disk if you want your file updated.
0
 
LVL 25

Author Comment

by:kevp75
ID: 22770055
duurrrrrr!!!

dang it's been a long day.   That's exactly what it was...  LOL
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question