qwerty3321 Posted November 26, 2018 Report Share Posted November 26, 2018 Hello there, i want to learn about writing and retrieving data in xml can anyone tell me where can i start with Thank you Quote Link to comment
crossrulz Posted November 26, 2018 Report Share Posted November 26, 2018 1. Help->Find Examples. Do a search for XML 2. Go look at packages in VIPM. NI has a Simple XML library that I used to figure some things out. Then JKI and MGI have their own XML packages you can have a look at. 1 Quote Link to comment
Benoit Posted November 27, 2018 Report Share Posted November 27, 2018 What is your final goal with the XML? Benoit Quote Link to comment
qwerty3321 Posted November 27, 2018 Author Report Share Posted November 27, 2018 7 hours ago, Benoit said: What is your final goal with the XML? Benoit I have an xml document. i would like to read and write back that xml file in labview Quote Link to comment
qwerty3321 Posted November 27, 2018 Author Report Share Posted November 27, 2018 Specifically i need to fetch and write the names and the values from the xml Quote Link to comment
Benoit Posted November 28, 2018 Report Share Posted November 28, 2018 So since it is quite generic, I will suggest you as crossrulz said and learn the basic stuff about xml standard. It is not difficult. you can even inside of a week create your own parser. Benoit Quote Link to comment
qwerty3321 Posted November 28, 2018 Author Report Share Posted November 28, 2018 I want to indicate the names and values of test 1 and test 2 in table Could you help me please new xml.txt Quote Link to comment
Benoit Posted November 28, 2018 Report Share Posted November 28, 2018 Do a match pattern on those: "<Name>Test 1</Name> <NumElts>" and then on "<NumElts>" By getting the character position in the file, you can easily replace the value in between with anew one. repeat with <Name>Test 2</Name> But why do you want to replace those value? are they already real measurement from real device? I have Ethical concern on what you are trying to do. Benoit Quote Link to comment
qwerty3321 Posted November 28, 2018 Author Report Share Posted November 28, 2018 i dont want to replace those values . i just want to indicate them on the front panel along with the names p.s These values are constants Quote Link to comment
Benoit Posted November 28, 2018 Report Share Posted November 28, 2018 well then the way I explained to you is the same... instead of replacing, report it. ? Benoit Quote Link to comment
qwerty3321 Posted November 28, 2018 Author Report Share Posted November 28, 2018 I'm really sorry but im really new to this. Which file palette do i need to use ? Is it the XML parser ? Quote Link to comment
Benoit Posted November 28, 2018 Report Share Posted November 28, 2018 (edited) For the simple task you want to do, just use search pattern. It should looks like this... Benoit Edited November 29, 2018 by Benoit Quote Link to comment
JKSH Posted November 28, 2018 Report Share Posted November 28, 2018 (edited) 2 hours ago, qwerty3321 said: new xml.txt Where did you get this XML document from? It is corrupted (There are many stray "-" characters, so XML parsers will give you an error) Also, take the time to follow @crossrulz's advice: On 11/26/2018 at 6:46 PM, crossrulz said: 1. Help->Find Examples. Do a search for XML 2. Go look at packages in VIPM. NI has a Simple XML library that I used to figure some things out. Then JKI and MGI have their own XML packages you can have a look at. Edited November 28, 2018 by JKSH Quote Link to comment
Benoit Posted November 28, 2018 Report Share Posted November 28, 2018 Since his xml document is not standard, I suggest him to use search pattern instead... so no matter is the txt file format/standard, it will work. Benoit Quote Link to comment
qwerty3321 Posted November 28, 2018 Author Report Share Posted November 28, 2018 1 hour ago, Benoit said: Since his xml document is not standard, I suggest him to use search pattern instead... so no matter is the txt file format/standard, it will work. Benoit doesnt it make complex using search pattern? i need to give each name and value in string array constant Quote Link to comment
Benoit Posted November 28, 2018 Report Share Posted November 28, 2018 No matter what tools you will use, you need to define what value you want... If you use xml tools, it will be similar. Benoit Quote Link to comment
qwerty3321 Posted November 28, 2018 Author Report Share Posted November 28, 2018 can you show me how to fetch the name and value of two elements of cluster test1 and test2 using xml palette please new xml.txt Quote Link to comment
Michael Aivaliotis Posted November 29, 2018 Report Share Posted November 29, 2018 *sigh* Quote Link to comment
JKSH Posted November 29, 2018 Report Share Posted November 29, 2018 15 hours ago, qwerty3321 said: can you show me how to fetch the name and value of two elements of cluster test1 and test2 using xml palette please Why do you refuse to use the code that @Benoit already wrote for you? Like I said before, your XML file is corrupted. The XML palette won't work on it. Quote Link to comment
qwerty3321 Posted November 29, 2018 Author Report Share Posted November 29, 2018 I would like to know the process of using the xml palette assuming i have a valid xml file Thank you Quote Link to comment
JKSH Posted November 29, 2018 Report Share Posted November 29, 2018 2 minutes ago, qwerty3321 said: I would like to know the process of using the xml palette assuming i have a valid xml file Open LabVIEW and click Help > Find Examples... then search for "XML". @crossrulz gave you this advice earlier. Quote Link to comment
qwerty3321 Posted November 29, 2018 Author Report Share Posted November 29, 2018 Thank you so much and sorry for the trouble😄 Quote Link to comment
JKSH Posted November 29, 2018 Report Share Posted November 29, 2018 5 minutes ago, qwerty3321 said: Thank you so much and sorry for the trouble😄 No problem. We are happy to help, but we'd appreciate it if you try to follow our instructions. Good luck with learning LabVIEW. Quote Link to comment
qwerty3321 Posted November 29, 2018 Author Report Share Posted November 29, 2018 i am able to read all the elements of my xml so i just want to unflatten the values from it Quote Link to comment
qwerty3321 Posted November 29, 2018 Author Report Share Posted November 29, 2018 (edited) so i was just trying to get the values of some elements from xml by using unflatten function . could you please help me with that Edited November 29, 2018 by qwerty3321 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.