Jump to content

read from xml-file


Recommended Posts

please help me with my vi. it always say, that string entrance is not connected. any ideas?

Are you reading an XML file that was created using LabVIEW? The XML components of LabVIEW are only really good for reading/writing the LabVIEW XML schema, so trying to read files written using a different schema probably won't work. Can you attach a copy of the XML file you're trying to read?

Link to comment

(If you're not using a LabVIEW-generated XML file)

I've had a pretty good experience using the LabXML toolkit. I had to move some files around to get it working (it didn't want to find a couple libs or dlls, as I recall), but once I got past that I found it fairly easy to use. I use it to translate the XML output of my bug tracker to generate nice-looking plaintext release notes.

Link to comment
Are you reading an XML file that was created using LabVIEW? The XML components of LabVIEW are only really good for reading/writing the LabVIEW XML schema, so trying to read files written using a different schema probably won't work. Can you attach a copy of the XML file you're trying to read?

Hi,

it is not a file created by LabVIEW. i attached the file.

Download File:post-6742-1164024117.xml

Link to comment
Yep - that file structure isn't going to work with the LabVIEW read primative. Have a look at the LabXML toolkit, as justin.goeres suggested.

Hi,

thanks for your reply. I have some problems with these vi's. I started the demo vi, but i could not run it. It is always searching for some files during start. Is it possible to convert the file i atteched with these vi's.

Thanks a lot.

Link to comment

Try this vi, make sure the javascript file (.js) is in the same directory as the vi. This vi will ask you to locate the xml file and then will import the data from the xml into a couple of arrays. Should demonstrate what you need to do.Download File:post-3040-1164225481.zip

Randy

*sigh* you need to give us more information than that - what files are missing?
Link to comment
  • 2 weeks later...
Try this vi, make sure the javascript file (.js) is in the same directory as the vi. This vi will ask you to locate the xml file and then will import the data from the xml into a couple of arrays. Should demonstrate what you need to do.Download File:post-3040-1164225481.zip

Randy

Hi Randy,

thanks for your help. If I select the file, i atteched above, i get a lot of errors.

Did you try your vi with "my" file?

Link to comment

Yep, ran with no problems on my PC. Do you have IE5 or above installed on your computer (the activeX object that I'm using in installed with IE5+)? What is the error message you are receiving? Also, make sure that the xml.js file is located in the same directory as the AccessingXMLData.vi, otherwise you can try the attached vi which has the javascript code embedded in the vi.

Randy

Download File:post-3040-1165249453.vi

Hi Randy,

thanks for your help. If I select the file, i atteched above, i get a lot of errors.

Did you try your vi with "my" file?

Link to comment
Yep, ran with no problems on my PC. Do you have IE5 or above installed on your computer (the activeX object that I'm using in installed with IE5+)? What is the error message you are receiving? Also, make sure that the xml.js file is located in the same directory as the AccessingXMLData.vi, otherwise you can try the attached vi which has the javascript code embedded in the vi.

Randy

Download File:post-3040-1165249453.vi

Hi Randy,

the vi now runs also on my pc. great! do you have a description for your vi?

thanks a lot man, this was a big help.

Thomas

Link to comment

Thomas,

Glad it helped :D ...just another example of utilizing external code to read xml files. It's important to realize what the javascript is doing because it is very specific to the XML file you submitted. The vi is loading the javascript code and then calling three functions in the javascript. The first function is loading the XML file that you located through the dialog, the next function is searching the XML for the "//Info/Created" and "//Info/Culture" node values and the third function is stepping through all the "//MeanPublic" nodes and putting the contents of the nodes into a spreadsheet string. This string is then passed to LV where it is put into an array.

A better example of calling external javascript and accessing/writing XML files can be found here:

http://forums.lavag.org/CR-Calling-Externa...ript-t4977.html

Randy

Hi Randy,

the vi now runs also on my pc. great! do you have a description for your vi?

thanks a lot man, this was a big help.

Thomas

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.