Solved

Quick XML Q...

Posted on 2008-10-21
4
242 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

691 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