Solved

Quick XML Q...

Posted on 2008-10-21
4
239 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

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 …
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

823 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