JKI Discussion Forums
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Identify empty elements from Easy Parse XML

#1
User is offline   fab 

  • Group: Members
  • Posts: 8
  • Joined: 02-September 10
I am using EasyXML for the first time and I love it.

One problem I have is that the XML messages I will be getting might not have every single element in the XML schema. I was hoping that the output of the "Easy Parse XML" would return my default values for the empty elements as opposed to returning the LabVIEW Defaults for the empty elements.

So in the example below, I would get for the vehicle OUT: ver =2010, pitch=-91, roll=-91.

Is there a way to identify the empty elements?

Attached Image: monthly_10_2010/post-2936-1288215635.png Attached Image: monthly_10_2010/post-2936-1288215639.png
0 kudos

#2
User is offline   fab 

  • Group: Members
  • Posts: 8
  • Joined: 02-September 10
This is the work around I plan to use:

Attached Image: EmptyElementEasyParseXML_workaround.png

Please let me know if there is a better way or a feature that I don't know about in Easy XML.

If this is not present in Easy XML, it would be nice for a future version to have a boolean to set if the output cluster should "use LabVIEW defaults for empty elements" or "use values wired to the 'LabVIEW Data (Type)' input".

Thanks,
Fab
0 kudos

#3
User is offline   fab 

  • Group: Members
  • Posts: 8
  • Joined: 02-September 10
I had to modify my workaround so it would work as a subVI.

I added a "hack" to make sure the output would be updated with the latest value. (Note that I did not do a snippet this time, because it messed up the references and now it wanted to add a property node for the local variable.)

Attached Image: EmptyElementEasyParseXML_wa_Hack.png

Find attached the VI.
Attached File  EmptyElementEasyParseXML_workaround.vi (28.09K)
Number of downloads: 50

Any help on making this easier/better would be much appreciated.

Thanks,
Fab
0 kudos

#4
User is offline   Jim Kring 

  • Group: JKI Team
  • Posts: 1,204
  • Joined: 15-March 06
Hi Fab,

I'm happy to hear that you love EasyXML :)

An option to use the input data type as the default values for the output sounds like a great feature addition, to me. We'll certainly add this to the list of feature ideas for a future release (and, I've heard this suggestion at least once or twice from other people). I've filed an official feature suggestion, in our tracker:
  • Case 10191: Need an option to use the input data type as the default values for "Easy Parse XML"

Regarding your solution (it's great, BTW!), I would probably use variant manipulation instead of control references, since control references requires the front panel to be loaded into memory and can cause some complications during the application build process and also can cause some performance issues. However, doing that requires recursion, which is a bit more complicated :)

Cheers!

-Jim
0 kudos

#5
User is offline   fab 

  • Group: Members
  • Posts: 8
  • Joined: 02-September 10

View PostJim Kring, on 29 October 2010 - 04:34 PM, said:

An option to use the input data type as the default values for the output sounds like a great feature addition, to me. We'll certainly add this to the list of feature ideas for a future release (and, I've heard this suggestion at least once or twice from other people). I've filed an official feature suggestion, in our tracker:Case 10191: Need an option to use the input data type as the default values for "Easy Parse XML"


Thanks! That will be great. How can I find out when this gets implemented?

View PostJim Kring, on 29 October 2010 - 04:34 PM, said:

Regarding your solution (it's great, BTW!), I would probably use variant manipulation instead of control references, since control references requires the front panel to be loaded into memory and can cause some complications during the application build process and also can cause some performance issues. However, doing that requires recursion, which is a bit more complicated :)


Jim,
You got me thinking. One of the systems we are going to implement this on uses LabVIEW Real Time. I don't have the Real Time system here right now to test, but I have a feeling my workaround won't work there. What do you think?

When you mention "variant manipulation" are you referring to the OpenG VIs that give out the type descriptors inside the variant?

Thanks,
Fab

PS: I like the new forum theme :)
0 kudos

#6
User is offline   Jim Kring 

  • Group: JKI Team
  • Posts: 1,204
  • Joined: 15-March 06

View Postfab, on 04 November 2010 - 07:58 PM, said:

Thanks! That will be great. How can I find out when this gets implemented?


We include a list of fixed issues and new features in the release notes of new versions. Also, you can feel free to inquire about the status and we'll let you know.


View Postfab, on 04 November 2010 - 07:58 PM, said:

You got me thinking. One of the systems we are going to implement this on uses LabVIEW Real Time. I don't have the Real Time system here right now to test, but I have a feeling my workaround won't work there. What do you think?


I'm pretty sure (but not 100% positive) that your work-around, using control references, won't work. The VIs will probably still have their front panels, but I think that they won't be loaded into memory and you'll get an error.


View Postfab, on 04 November 2010 - 07:58 PM, said:

When you mention "variant manipulation" are you referring to the OpenG VIs that give out the type descriptors inside the variant?


Yep, that's exactly what I meant: the OpenG LabVIEW Data Tools library (oglib_lvdata package). These are the VIs that we use, under the hood of EasyXML, to manipulate the LabVIEW data as a variant.

View Postfab, on 04 November 2010 - 07:58 PM, said:

PS: I like the new forum theme :)


I noticed :) Thanks for the feedback.

-Jim
0 kudos

#7
User is offline   fab 

  • Group: Members
  • Posts: 8
  • Joined: 02-September 10

View PostJim Kring, on 04 November 2010 - 09:57 PM, said:

I'm pretty sure (but not 100% positive) that your work-around, using control references, won't work. The VIs will probably still have their front panels, but I think that they won't be loaded into memory and you'll get an error.


Jim,
Unfortunately we were right :) I was able to test this code in a cRIO and I get error 53 coming out of the "To More Specific Class"...

So, either I will have to dive into the variant manipulation or I will write a less generic code that works only with my XML Schema. Given the amount of time I have for this project, unfortunately, I will have to go with the less elegant option. :)

Thanks again for the help and I will be anxiously waiting for the new release of EasyXML with default values :)

Thanks,
Fab
0 kudos

#8
User is offline   Jim Kring 

  • Group: JKI Team
  • Posts: 1,204
  • Joined: 15-March 06

View Postfab, on 04 November 2010 - 11:01 PM, said:

Jim,
Unfortunately we were right :) I was able to test this code in a cRIO and I get error 53 coming out of the "To More Specific Class"...

So, either I will have to dive into the variant manipulation or I will write a less generic code that works only with my XML Schema. Given the amount of time I have for this project, unfortunately, I will have to go with the less elegant option. :)

Thanks again for the help and I will be anxiously waiting for the new release of EasyXML with default values :)

Thanks,
Fab



Thanks for the update. Let me know if you have any questions or issues with the variant manipulation. My guess is that I have about as much experience with this as anyone on the planet Posted Image
0 kudos

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic