The output from flatten from XML is not as elegant as it could be. A big advantage of XML is that it is both human and machine readable, but flatten to XML seems to really neglect the human aspect, and can be a bit akward to process.
Here is the output from a simple structure using .net serialization:
<?xml version="1.0"?>
<TestConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<VISAaddr>GPIB::07</VISAaddr>
<DBServer>localhost</DBServer>
<CalFolder>C:\Calfiles\</CalFolder>
</TestConfig>
It is nice, short, and human readable.
Now here is the output of an equivilent structure from flatten from XML:
<?xml version='1.0' standalone='yes' ?>
<LVData xmlns="http://www.ni.com/LVData">
<Version>12.0.1</Version>
<Cluster>
<Name>TestConfig</Name>
<NumElts>3</NumElts>
<Refnum>
<Name>VISAaddr</Name>
<RefKind>VISA</RefKind>
<Val>GPIB::07</Val>
</Refnum>
<String>
<Name>DBServer</Name>
<Val>localhost</Val>
</String>
<Path>
<Name>CalFolder</Name>
<Val>C:\Calfiles</Val>
</Path>
</Cluster>
</LVData>
Its overly long, 21 lines versus 6 from .net. A better way to represent the same information would be something along the lines of:
<?xml version='1.0' standalone='yes' ?>
<LVData xmlns="http://www.ni.com/LVData" version="12.0.1">
<Cluster name="TestConfig" NumElts="3">
<Refnum name="VISAaddr" kind="VISA">GPIB::07</Refnum>
<String name="DBServer">localhost</String>
<Path name="CalFolder">C:\Calfiles</Path>
</Cluster>
</LVData>
Its still not as elegant as the .net result, but I think it looks better than the original. This may seem like a trivial issue with the small XML files I presented, but when you are storing much larger data structures in XML it starts to become a big mess.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.