Due to the form my instance documents can (sometimes) take, I have a need to flatten my documents from:
Document A
<rootElement>
<element1 value="element1Value">
<element2 value="element2Value">
<element3>element3Text</element3>
</element2>
</element1>
</rootElement>
Document B
<rootElement>
<element3 element1="element1Value"
element2="element2Value">element3Text</element3>
</rootElement>
Bandwidth is one of my primary motivations for this approach, as I anticipate many messages of this type per second. Also all of the data items for Document A are not always available, so the transform from Document A to Document B would be applied in some cases but not in others.
I have searched this group and seen example stylesheets for this type of transform (or similar).
My question is about the the "style" of this approach. In general, does this seem like a reasonable approach to reducing the size of XML documents? By the way, I plan to compress the documents prior to transmission whether Doc. A or Doc. B.
I welcome any comments.
FGB
Document A
<rootElement>
<element1 value="element1Value">
<element2 value="element2Value">
<element3>element3Text</element3>
</element2>
</element1>
</rootElement>
Document B
<rootElement>
<element3 element1="element1Value"
element2="element2Value">element3Text</element3>
</rootElement>
Bandwidth is one of my primary motivations for this approach, as I anticipate many messages of this type per second. Also all of the data items for Document A are not always available, so the transform from Document A to Document B would be applied in some cases but not in others.
I have searched this group and seen example stylesheets for this type of transform (or similar).
My question is about the the "style" of this approach. In general, does this seem like a reasonable approach to reducing the size of XML documents? By the way, I plan to compress the documents prior to transmission whether Doc. A or Doc. B.
I welcome any comments.
FGB