02-19-2020 04:54 AM
Hi to everyone,
i'm new in the community and also in LabVIEW programming so i'd like to say sorry in advance if my question it's very easy.
The point is that, i have an XML file (attachment 1) in which a list of contacts is present (in the file only one contact is present).
In attachment1 i have tried to highlight which are the connection between XML blocks by using colors. So if a colored line is present under a tag that means the tag is expanded somewhere in the XML (you will see the same color where the tag is expanded).
I have to read this XML file and to create a structure as described in attachment 2 to perform some elaboration on the data.
I have tried something by reading from online forum but the overall code is very hard coded and i'm sure that there is a better solution to my problem. Can someone give me a hand on this topic cause now i'm stucked so any help would mean a lot for me.
Thank You
Mathias
02-19-2020 08:24 AM
Hi Mastro,
To start with - yes, this is possible.
To a certain extent, with built-in nodes in LabVIEW you'll probably end up doesn't something at least a little 'hard-coded' to process an XML file.
There are also libraries that can parse XML files that might have more flexibility.
The Unflatten from XML node is where you'd want to start with the built-in options (after reading the string from the text file using the standard Text File nodes ({Open/Create/Replace,Read from Text,Close} File).
You'll need to define a typedef that describes your data structure to do this reliably.
02-19-2020 09:00 AM
Hi cbutcher,
thank you for your reply.
Could you please give me some examples of these not-built-in libraries?
i'm already working with the built in functions but the code it's very hard-coded.
The point is that i want to end up with a VI that is possible modify and update in the future.