|
-
Jun 15th, 2001, 03:23 PM
#1
DOM questions
I have the foll code snippet in an asp file. Basically it checks if the node "name" has the submitted value. If no, add the node. If yes, modify the node.
Set ElemList = xmlDoc.getElementsByTagName("name")
bolfound = false
For i=0 To (ElemList.length -1)
x = ltrim(rtrim(ElemList.item(i).xml))
if "<name>" & ltrim(rtrim(Request("name"))) & "</name>" = x then
bolfound = true
exit for
end if
Next
if not bolfound
'add new
else
'modify existing
end if
This works fine but I have 2 questions:
1. Is there a better way to do it - instead of looping?
2. How can the existing values be modified?
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|