Jump to content
LabSeb

XML-Schema (XSD) to Cluster

Recommended Posts

Hi, 

 

i'm trying to read and write XML-Files with LabView. I figured out that JKI EASY XML helps a lot. Still i have to create a cluster describing the structure of the XML-File i want to read or write. 

 

I have a large XML-Schema describing the structure of the XML-File. Is there any way to create the cluster automatically? The manual work would be a lot of effort. I thought about creating the cluster dynamically but it seems to be not possible within labview. Another option could be to edit the .vi file using other software/programming language but at least with a text editor i couldn't achieve readable code. Is the file format documented?

 

Any ideas?

 

Thanks

 

Sebastian 

Share this post


Link to post
Share on other sites

Hi Sebastian,

 

You can translate the xml to labview using the scripting functions.  It's not trivial, though.  You'll need to understand VI server and references reasonably well.

 

You can turn on the scripting functions in more recent versions of LV under Options>>VI Server>>VI Scripting.

 

It's a little dated, but check the GenINI code at http://lavag.org/topic/11920-genini-generate-readwrite-code-for-ini-files/.  In particular, how typedefs are generated.

 

Joe Z.

Share this post


Link to post
Share on other sites

Hi Joe, 

 

thanks for you reply. I stumbled over VI-Scripting a few days ago but it's still all new to me. I'll have a closer look to your INI script as an example- 

 

Sebastian

Share this post


Link to post
Share on other sites

Hi

You can individually extract your datas if you know their names like in my exemple.

 post-5178-0-91474900-1393330972_thumb.pn

Regards

Eric

Share this post


Link to post
Share on other sites

Thanks for the two advices i think i'm going to use both. I'm doing some progress but the result will probably work only for my XML-Schema or very similar schemata.

Up to know my VI-Script creates a lot of nice combo boxes from my xs:simple types. :D

 

@Eric: I tried to use  these labview functions

Unbenannt
Album: LabSeb
1 images
0 comments

but the didn't work for XML-Schemata. Instead i used some loops. They will be replaced by this invoke node.

Share this post


Link to post
Share on other sites

Did you manged to get this working, using invoke nodes? I am try to parse XML data to a cluster on a cRIO-9022, unfortunately not have much luck.

 

Thanks, Tim 

Share this post


Link to post
Share on other sites

Join the conversation

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

Guest
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.