So I have a small java program that uses an XSL template to sort an incoming XML document. (only the OrderLine elements in the below example are sorted, the sort itself is working great)
Also, it is sorting based on the OrderLine attributes: IsHazmat="Y" (first) number="S-3" (second)
Input XML Document:
Output XML Document:
As you can see, the formatting is off a little making the output XML document look messy.
My goal, is to take the Input document and produce an Output document that looks exactly like the Input document except with the sort applied.
Do you guys have any tips that will make an Output XML format nicely?
Tip: Control white space in an XSLT style sheet
Chapter 4. Creating Output > Dealing with Whitespace
<xsl:sort select="@IsHazmat" order="descending"/>
<xsl:sort select="substring-after(@number,'-')" order="ascending" data-type="number"/>
Apart from possible mixed up OrderLine and mailbox (but not only, far from that, the template OrderLine cannot be corrected by only changing name back to mailbox...) this xsl:sort line cannot be correct. It should look at least like this.