Solved

Quick XML Q...

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

Suggested Solutions

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
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…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

737 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