Hello.
The last two lines look a little strange:
BasicAttribute node1attr = new BasicElement(doc,“node1attr”,“attrvalue”);
Is this correct? Should the instantiation be of a “new BasicAttribute” too?
(This looks likely to cause a problem at some point - instantiating a BasicElement into a BasicAttribute field…)
Also, I am not sure, but I think that appendChild() may be the wrong way to set an attribute. Isn’t Element.setAttribute(String name, String value) better - or even Element.setAttributeNode(org.w3c.dom.Attr)?
Perhaps someone more familiar with DOM can comment on this…
Cheers,
Trevor.
#API-Management#webMethods#webMethods-Tamino-XML-Server-APIs