I need to add same attribute to different nodes. Is there a way to define the attribute once and use it many times ?
Here is what I tried to do:
Set myAttribute = xmlDoc.createAttribute("operation")
attribute.value = "delete"
Now I can do the following:
node.attributes.setNamedItem(myAttribute)
But if want do add the same attribute to another node, I get an error. Like:
node2.attributes.setNamedItem(myAttribute)
So, is there a way to re-use the attribute without repeating the first two lines of code?