Hello everyone
Iβm new on n8n, so sorry in advance if my question may seem trivial or a bit silly.
My question is very simple, I have an XML file like this one:
https://catalogue.bnf.fr/api/SRU?version=1.2&operation=searchRetrieve&query=bib.isbn%20adj%20"978-2-01-322343-0"&recordSchema=intermarcXchange
How could I extract for example specifically the field with the tag β015β and the code βaβ, which would give me β00914463β please ?
Because when I want to transform it into XML to JSON, I lose the separation by tag, I have then all the βmxc:datafieldβ which are added, but I really need by tag.
Thanks in advance to you
Dadourlou
Hi @Dadourlou, welcome to the community
Any chance you can share your XML file as text rather than a screenshot? This would make it a lot easier for peeps to give it a go
You can use the option for preformatted text to share code:
1 Like
Obviously, sorry for the omission, I edited my message by putting the URL of the file (it is a French public API).
Perfect, thanks a lot!
I have put together an example workflow extracting 00914463
for you:
Example Workflow
In this workflow, I first convert this XML data into JSON data. Then throw away the values I am not interested in using the Set node, splitting out the results via an Item lists node to filter these for the tag in question.
I then split out the subfields for the matching tag and filter for the correct code before formatting the result:
Hope this helps! Let me know if you have any questions on this
1 Like