Jump to content
crelf

Order of array elements preserved?

Recommended Posts

Firstly, and I know I've said this before, but EasyXML is a great product that really fills a niche in the LabVIEW world. My customer wants a new version of a long-running application, and using EasyXML has saved me man-days of design, development and test time - so a big thanks to JKI!

 

On to my quesiton: XML inherently doesn't support ordering of elements (that's why we can attached attributes to elements, so we can distinguish between them), but I was wondering if EasyXML does. From my limited testing, it looks like EasyXML will populate an array of elements in the order they appear in the XML file on disk - is this always the case?

 

Here's a simple illustraive example - imagine this is deep inside an XML file:

 

<GroupOfThings>
    <Thing ID="1">
         <Size>Small</Size>
         <Colour>Red</Colour>
    </Thing>
    <Thing ID="2">
         <Size>Medium</Size>
         <Colour>Green</Colour>
    </Thing>
    <Thing ID="3">
         <Size>Large</Size>
         <Colour>Blue</Colour>
    </Thing>
</GroupOfThings>

 

Will the array in my XML cluster always have these elements in the order they appeared in the file? I know that it's not technically right to rely on this, but I'm hoping the answer is "yes" :)

Share this post


Link to post
Share on other sites

Hey crelf,

 

Yes, I believe that the current implementation of EasyXML does always preserve ordering when converting between LabVIEW and XML data. I don't see any reason why this would ever change, but we can't guarantee it, since (as you've mentioned) the XML specification does not support ordering of elements.

 

-Jim

Share this post


Link to post
Share on other sites
Yes, I believe that the current implementation of EasyXML does always preserve ordering when converting between LabVIEW and XML data. I don't see any reason why this would ever change, but we can't guarantee it, since (as you've mentioned) the XML specification does not support ordering of elements.

Thanks Jim - that's exactly the answer I was expected, and hoping for.

Share this post


Link to post
Share on other sites

Thanks Jim - that's exactly the answer I was expected, and hoping for.

 

You're very welcome, and I'm pleased to hear that EasyXML has saved you time and effort on your project work. Thanks for sharing that feedback :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

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