View Single Post
  #2 (permalink)  
Old October 30th, 2003, 05:49 AM
joefawcett's Avatar
joefawcett joefawcett is offline
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

If I've understood, in your code, just before you create the name element you need to check whether or not the "txtName" has any content, if not do nothing with name element otherwise do as now.
The steps are:
1) Load doc
2) If successful go to step 4
3) Create doc with just <root/>
4) Select name node
5) If txtName has content replace content otherwise ignore
6) Add phone numbers

Steps 4 and 5 are done like this after loading doc into objDom
Code:
sName = Request("txtName")
Set oNameNode = objDom.selectSingleNode("/root/Name")
If Len(sName) > 0 Then
  oNameNode.text = sName
End If
Joe (MVP - xml)
Reply With Quote