How to Extract XML File with Parsing

the following is ensured?

if this Deserialize XML is the last activity within the RnD Xaml, then just frag and drop an empty comment at the very end and retry. Feel free to share the xaml with us

@ppr

Please find the xaml. Please help in the workflow of Data Extraction xaml.
XML_Extraction.zip (2.4 KB)
il-bai2.xml (32.0 KB)

As mentioned

Did it (just modified the path to my specifics)
grafik

And got:
grafik

As it was the last sequence it was not working at your end, due all contexts were off / no longer accessible. Thats why we add the comment to have new last activity

@ppr

Thank You so much. Next what are the steps I should include to extract the data (165 and subsequent data). Can you please help in adding the steps in the xaml file which I have send. It will be of great help.

@ppr

Why you have taken 205 in xDOC.Descendants()(205).Name

because of randomly picking up a p element for the Namespace check

@ppr

ok randomly we can enter any number like 205 or 206 etc to check Namespace .

xDoc.Root.Descendants(XMLText+“p”).Select(Function(x)x.Value).ToList(In this expression what we are doing )

I am again getting same error.

XMLText is not good variable name for a XNamespace variable

We showcased already the same here:

@ppr

changed the variable Name but still error. Do you have the sample xaml file. Can you share if you dont mind

show us variable panel, where you had defined xnsText
show us assignment where you have set the related namespace value to xnsText variable

@ppr


here we gave hint about the datatype: XNamespace

Also it is explained in the shared link:

We we do see a 23 ping-pong chat in which

  • the main building blocks were given in post 3 & 4
  • and also validated checked in post 3

So we recommend:

  • have a small break
  • reread all shared infos / links and get it understood
  • implement it at your end

Your are close to get it done and with the right modelling steps you will suceed in only a few minutes

1 Like

@ppr

Sure will follow the steps

@ppr

I could retrieve all the p element list. For the Linq query,


xe I need to declare ?

(From xe in xDoc.Root.Descendants(xnsText + “p”)
let v = xe.Value
Let chk = System.Text.RegularExpressions.Regex.isMatch(v, “^\d+,165,”)
Where chk
Select x = v).toList

Need help in the linq query

xe I need to declare ?

1 Like

Assign Activity
165CodeValuesList | List(of String) =

(From xe in xDoc.Root.Descendants(xnsText + "p")
let v = xe.Value
Let chk = System.Text.RegularExpressions.Regex.isMatch(v, "^\d+,165,")
Where chk
Select x = v).toList

xe is like a local variable and resides within the LINQ

@ppr

When I want to extract all the 165 codes can I use the below workflow?Is this correct?

we encourage you to play and test as it cannot do any damages.

LINQ will produce:
grafik

@ppr

But in my case its not giving any output in the message box . I have used for loop . Is the statement complete where chk in Linq query or I need to put some condition?

we suggest to work with debugging panels
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum

everything was done as described in the thread

  • Namespace setup
  • ensured that there is always another activity at the very end…

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.