Hi Everyone, I am using the sarissa javascript library to create xml on the client in a web application. My question is how can I add attributes to the root node? I am really trying to pass a small xml string to the server like basically a 1 liner of XML. I tried this and it doesn't work. oDomDoc does not support the "setAttributeNode" method. I must be adding the attribute incorrectly.
var oDomDoc = Sarissa.getDomDocument("", "item");
var attrib = document.createAttribute("something");
attrib.nodeValue = "something";
oDomDoc.setAttributeNode(attrib);
I feel I must be trying to add it to the document object instead of the node. Can anyone point me in the right direction. Thanks so much for any help.
Cheers, ~ck in San Diego