LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Where can I find an example of a vi which reads a xml file using the Labview schema (LVXMLSchema.xsd)?

Rikki,

Did you try writing to file and specifying text as "<tag>value</tag>"?

TheDillo
0 Kudos
Message 11 of 17
(1,141 Views)

Hi Rikki,

The LV XML functions do not support attributes, only elements.  All of the values must be between unique tags, and not inside one tag.  The first line of your XML:

<Step StepID="0" Wait="2000" Fbck="0">

includes three attributes that cannot be written with the LV XML driver.  If possible, change the structure of your XML to separate the attributes into tags:

<Step>
 <StepID>0</StepID>
 <Wait>2000</Wait>
 <Fbck>0</Fbck>
 <UsrInfo>Operating Text</UsrInfo>
....

Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.0, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
Message 12 of 17
(1,132 Views)
Thanks Michael
 
I got your point. But for my application i want that format only. Is there any other way of doing that.
Plz help.
Rikki
0 Kudos
Message 13 of 17
(1,124 Views)
I tried that "<tag>value</tag>".It is writting this way properly. But i want to set attributes in the Tag like
<Step StepID="0" Wait="2000" Fbck="0">.
I got a reply from Michael. According to him it is not possible.
I want that format only. How to procced TheDillo.
Rikki
0 Kudos
Message 14 of 17
(1,121 Views)
Instead of writing values, write attributes in your string.  Try starting with the Write to Text File vi, and using the Concatenate Strings vi to build strings with several parts.  Consider a simple example with three parts.

The first part might be something like: "<tag attribute="
The second part would be where you wire in your specific data
Your third part would be where you closed the tag with: ">"

Otherwise, your best bet may be to rework your data's format.

Hope this helps!
TheDillo
0 Kudos
Message 15 of 17
(1,116 Views)
OK- this is not a great code example however it does parse common scalar datatypes.  It worked well enough for the uses I needed it for. 

0 Kudos
Message 16 of 17
(1,110 Views)
Thanks Dillon and all......
Now I am able to set the attributes of the tag in the XML file by modifying the "ValueToXMl.vi" which i got from discussion form only. I hope it will work fine. Now i want to append in to XML file.When i am writting again in to the file it is overwritng the previous values. how to proceed.
Rikki
0 Kudos
Message 17 of 17
(1,092 Views)