Solved

Quick XML Q...

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now