22-05-20 03:48 PM
22-05-20 05:08 PM
22-05-20 06:35 PM
23-05-20 07:12 AM
Hi again,
XSLT is the standard way to transform one XML format to another but this requires much learning to get good at.
in C# you can use the object Xdocument to manipulate XML elements and it looks like you have been trying this from previous posts.
if you don't like the Xdocument coding route then there are always alternatives. Perhaps reading the XML as a Text data type and performing string matches for the values you wish to change? More risky but more intuitive for a non developer.
if you are comfortable manipulating collections then try to get the XML as a collection, make the changes and serialize back to XML. This requires more C# code stages. I have some that I can send you to help-send me your email directly to peter.lacken@renroros.no.
Hope this is some inspiration and good luck with your automation!
peter
23-05-20 08:36 AM
Hi Peter,
Thanks for your answers.
I tried to do it exactely like mentioned here: https://stackoverflow.com/questions/544310/best-way-to-change-the-value-of-an-element-in-c-sharp
The difference in BluePrism is that the XML is read from String Data Item and not from a file. and It will be updated in a DataItem too.
If I have this xml text saved in a String (InputXML)
<MyXmlType>
<MyXmlElement>Value</MyXmlElement>
</MyXmlType>
and I want to update the value of elemnt "MyXmlelement" and save the new text in one Output String Data Item.
Do you know how to do it?
Thanks in advance,
Ayyoub