| 1 | <xsl:stylesheet |
| 2 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| 3 | version="1.0"> |
| 4 | |
| 5 | <xsl:output indent="yes"/> |
| 6 | |
| 7 | <xsl:template match="@* | node()"> |
| 8 | <xsl:copy> |
| 9 | <xsl:apply-templates select="@* | node()"/> |
| 10 | </xsl:copy> |
| 11 | </xsl:template> |
| 12 | |
| 13 | <!-- we use match="Entity" because we want to sort only top-level elements (contained in Entity) --> |
| 14 | <xsl:template match="Entity"> |
| 15 | <xsl:copy> |
| 16 | <xsl:apply-templates select="@*"/> |
| 17 | <xsl:apply-templates select="*"> |
| 18 | <!-- with translate function sorting will be case-insensitive, |
| 19 | because it will change lower-case letter to upper-case for sorting --> |
| 20 | <xsl:sort select="translate(local-name(), 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/> |
| 21 | </xsl:apply-templates> |
| 22 | </xsl:copy> |
| 23 | </xsl:template> |
| 24 | |
| 25 | </xsl:stylesheet> |
| 26 | |