I'm still patiently waiting for my boss to sign it off! Until then it's the standard 2003 script editor. I don't know how I ever programmed without Intellisense before!
I don't know if this is a different context, but I'm still having a couple of problems with this.
I'm trying to check the length of the nodes once I have found them and then add to their length until they match the length of another done. I am getting the following error:
The namespace prefix my in the following element does not map to a URI: my:UID
It's obviously called my:UID otherwise it wouldn't even call that sub in the first place! Any ideas?
Sub
btnJumpOrder_OnClick(eventObj)
Set oNode = XDocument.Dom.selectNodes ("/my:myFields/my:Order")
If orderIsFresh(oNode) Then
Dim i, iNode
Set uNode = XDocument.Dom.selectNodes ("/my:myFields/my:Users")
'There is only one order
Set iNode = oNode.item(0)
For i=0 to uNode.length - 1
Do While iNode.selectNodes("my:UID").length - 1 < i
addDomElement iNode, "my:UID", ""
Loop
iNode.selectNodes("my:UID").item(i).Text = uNode.item(i).selectSingleNode("my:UNetID").Text
Next
End If
End Sub
Sub
addDomElement(objParentNode, strName, strValue)
Set objNode = XDocument.Dom.createElement(strName)
If strValue <> "" Then objNode.Text = strValue
objParentNode.appendChild objNode 'Error occurs here
End Sub