Hello team I want to extract some data from an XML document and then convert it to xlsx file .

hello team , can any help me how can i extract data from a xml file using xpath node and then convert it to a excel file.

am using xml reader to read the xml file and querying am using xpath.

my requirment is from the xml file i need to extract value of , DAT01 and DAR01 in three different column . this is an small example my xml file has 2000+ value like this . please help how can i perform this

image

Hi @Jithin1893 -

Instead of a screenshot, can you upload a small example text file? The community is much more likely to help when you post real data :slight_smile:

2 Likes

ORE000001004_20231006063033_20231003_135427_01494027rdptestdummyv1 - Copy.xml (2.8 KB)

hello scottf , pleasee see the example file

Are you sure your description is correct? You say you want three output columns but you only reference DAR01 and DAT01. You have PERNR highlighted, What do you want? Also if your XML file has multiple instances of these elements you should supply a sample file with at least two of each element. This workflow works with your data. My xpath skills are pretty weak which is why I asked for a file with multiple elements.

1 Like

Hi @rfeigel , let me check i can provide another file with more info

Hello @rfeigel,

is it possible to select only DAR01 =50 , because in my file may change from 41, 50,51 so these 50 ,51 etc represents certain date types. so if i want to filter it by DAR01 with this date type 50 how can i do it

Please provide more data with different DAR01. Also, if you want to filter DAR01 on 50, what do want to do with the other data elements?

example.xml (5.7 KB)
Hi @rfeigel,

please note i have provide more examples.
you can see DAR01, DAR02, DAR03 etc etc so DAR01 values are varying like it may 5O as value, it may have 43 as value etc so that why i need to get filtering by values for each DAR01.

I need to filfer DAR01,DAR02,DAR03,DAR04,DAR05 with either 41,50,51,52 etc etc whatever values upon requirement.

You’re new file throws the following error in the XML Reader. I’m not an XML expert. Maybe someone else can figure it out.


Also, I don’t understand how you want to filter. You seem to be saying two things, i.e. you want to filter on DAR01 or you want to filter on all the DARs.

1 Like

Removed the leading spaces in example.xml and now get this error:


It appears that you need to clean up this file. I also added a filter to the workflow for DAR01.

1 Like