Sidebar

How can I do setnode with a namespace?

0 votes
316 views
asked Mar 18, 2016 by michael-h-5027 (14,350 points)
Want to add an attribute like this:
xsi:type=ExtrinsicObjectType
 
But the setNode with the "xsi" namespace produces an error.
message.setNode('/Envelope/Body/AdhocQueryResponse/RegistryObjectList/Identifiable/@xsi:type', 'ExtrinsicObjectType');
 
 
 

 

1 Answer

0 votes

There are a couple of work arounds:

1. You can add the type attirbute without the namespace and then do a .replace(' type=', ' xsi:type='));

 
2. You can use a template for the node that contains the namespace.
answered Mar 18, 2016 by michael-h-5027 (14,350 points)
...