Matthieu
Matthieu

Reputation: 45

VBS append a child node

i'm trying to add a child node to the GG node.

Dim objCurrNode : objCurrNode = "/AA/BB/CC/DD/EE/FF[@name=""Hello""]/GG"
Set objKid = oXML.createElement("HH")
objCurrNode.appendChild (objKid)

I get Object required... What am i doing wrong ?

Thanks :)

Upvotes: 0

Views: 724

Answers (1)

Ekkehard.Horner
Ekkehard.Horner

Reputation: 38745

To make objCurrNode.appendChild objKid (without (), because you call a Sub) work, objCurNode must be an object, it has to be assigned to with Set. The XPath expression

"/AA/BB/CC/DD/EE/FF[@name=""Hello""]/GG"

can't be used to create an object, but you could use the .selectSingleNode method to find the node.

Upvotes: 1

Related Questions