Sample XML:
<DATA>
<DIMENSION Name="NST1">
<MEMBERS>
<MEMBER>
<LABEL>[None]</LABEL>
<AT Name="IsCalculated">N</AT>
<AT Name="SwitchSignForFlow">N</AT>
<AT Name="SwitchTypeForFlow">N</AT>
</MEMBER>
<MEMBER>
<LABEL>TotalNST1</LABEL>
<AT Name="IsCalculated">N</AT>
<AT Name="SwitchSignForFlow">N</AT>
<AT Name="SwitchTypeForFlow">N</AT>
</MEMBER>
</MEMBERS>
</DIMENSION>
<DIMENSION Name="NST2">
<MEMBERS>
<MEMBER>
<LABEL>[None]</LABEL>
<AT Name="IsCalculated">N</AT>
<AT Name="SwitchSignForFlow">N</AT>
<AT Name="SwitchTypeForFlow">N</AT>
</MEMBER>
<MEMBER>
<LABEL>TotalNST1</LABEL>
<AT Name="IsCalculated">N</AT>
<AT Name="SwitchSignForFlow">N</AT>
<AT Name="SwitchTypeForFlow">N</AT>
</MEMBER>
</MEMBERS>
</DIMENSION>
|
| MANY MANY MORE DIMENSIONS HERE
|
</DATA>
Using the above xml file i am trying to use VBA to create a dictionary with a number of keys which correspond to the name attributes of each DIMENSION node and all the elements contained with in concatenated as the entry associated with that key.
IE:
Key: Data:
NST1: NST1; [None]; N; N; N;
NST2: NST2; [None]; N; N; N;
It is simple enough to use getElementsByTagName(DIMENSION) however my problem is that as you can see the XML file contains many dimensions with the same layout and tag name "DIMENSION" only distinguished by attribute Name in the Dimension tag.
Is there a way to select the dimension by its "name attribute" ie NST1, NST2 etc rather than it's tag name?
I have the code required to create these dictionary entries once my VBA script is "looking at the correct dimension" my issue is to "look at" a dimension by its attribute?
Any thoughts or ideas would be gratefully received.
Many thanks