View Single Post
Old February 11th, 2019, 12:05 PM
pedromcerveirapinto pedromcerveirapinto is offline
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Feb 2019
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sort portion of XML File

Good day,
I'm new to the forum and to XSLT Transformations. I've read a similar post to mine but found no answer.
I have a rather large XML file which I need sorted in some blocks.
The XML structure file is:

Where inside Lines we can have any number of CreditLines and/or DebitLine and in whatever order, that is we can have them interchanging.
I need this Lines block sorted so that I have all CreditLines and only after that all DebitLines.
Furthermore this Lines block repeats along the file.
Could you please help me?

My poor attempt at getting this done was as follows:
<xsl:template match="node()|@*">
<xsl:apply-templates select="node()|@*"/>

<!-- Sort Lines -->
<xsl:template match="Lines">
<xsl:sort select="name()"/>


Hope you can help me.