Jump to content

Order of array elements preserved?


crelf

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" :)

Link to comment
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

Link to comment
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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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