Hi there .
is it possible to add an attribute to an XML node when using the servoy built in XML methods? ( https://wiki.servoy.com/display/Serv52/XML). I cant seem to find any reference to adding an attribute… only references to listing an attribute.
So for example
The following code
var _xml = <xml/>;
_xml.myTestXML = <myTestXML/>
var _HeaderInfo = <HeaderInfo/>
var _Sender = <Sender/>;
_Sender.PrimaryID = "test";
_HeaderInfo.Sender = _Party;
_xml.myTestXML.appendChild(_HeaderInfo);
application.output(_xml);
produces the following output:
<xml>
<myTestXML>
<HeaderInfo>
<Sender>
<PrimaryID>test</PrimaryID>
</Sender>
</HeaderInfo>
</myTestXML>
</xml>
But I want it to produce output like this. (the difference is the additional [testattribute = "hello ] value on the [primary ID] node)
<xml>
<myTestXML>
<HeaderInfo>
<Sender>
<PrimaryID testattribute = "hello" >test</PrimaryID>
</Sender>
</HeaderInfo>
</myTestXML>
</xml>