Did research here sort via xpath and here Grouping using the Münchian Method but couldn't find how to adapt for my situation sort on 'fieldValue' for 'Label' inside 'userField[23]', inside 'SysStructure_FIELD[146]'
This is my xslt:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:strip-space elements="*" />
<xsl:output method="xml" indent="yes" />
<xsl:template match="/Root/STRUCTURESet/STRUCTURE/userField[2]/STRUCTURE_Fields/SysStructure_FIELD">
<xsl:copy>
<xsl:apply-templates select="objectId"/>
<xsl:apply-templates select="userField">
<xsl:sort select="fieldLabel[10]/fieldValue" data-type="text" order="ascending"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
The desired output: to have the fieldValue's Labels sorted is not achieved. Can you help out?
xml in shortened form is below ( 'userField(3)', inside 'SysStructure_FIELD(3)' ) :
<Root version="1-1">
<STRUCTURESet>
<STRUCTURE id="STRUCTURE_0">
<objectId class="STRUCTURE">
<identifier>49</identifier>
<primarySystem>Sys</primarySystem>
<label>Sys_Default_Structure</label>
</objectId>
<userField>
<fieldLabel>Description</fieldLabel>
<fieldValue>Sys Default structure level</fieldValue>
<fieldType>character</fieldType>
</userField>
<userField>
<fieldLabel>Fields</fieldLabel>
<STRUCTURE_Fields>
<SysStructure_FIELD>
<objectId class="SysStructure_FIELD">
<primarySystem>Sys</primarySystem>
</objectId>
<userField>
<fieldLabel>Hide</fieldLabel>
<fieldValue>0</fieldValue>
<fieldType>numeric</fieldType>
</userField>
<userField>
<fieldLabel>Label</fieldLabel>
<fieldValue>System_value</fieldValue>
<fieldType>character</fieldType>
</userField>
<userField>
<fieldLabel>MainReturn</fieldLabel>
<fieldValue/>
<fieldType>character</fieldType>
</userField>
</SysStructure_FIELD>
<SysStructure_FIELD>
<objectId class="SysStructure_FIELD">
<primarySystem>Sys</primarySystem>
</objectId>
<userField>
<fieldLabel>Hide</fieldLabel>
<fieldValue>0</fieldValue>
<fieldType>numeric</fieldType>
</userField>
<userField>
<fieldLabel>Label</fieldLabel>
<fieldValue>Off_Market</fieldValue>
<fieldType>character</fieldType>
</userField>
<userField>
<fieldLabel>MainReturn</fieldLabel>
<fieldValue/>
<fieldType>character</fieldType>
</userField>
</SysStructure_FIELD>
<SysStructure_FIELD>
<objectId class="SysStructure_FIELD">
<primarySystem>Sys</primarySystem>
</objectId>
<userField>
<fieldLabel>Hide</fieldLabel>
<fieldValue>0</fieldValue>
<fieldType>numeric</fieldType>
</userField>
<userField>
<fieldLabel>Label</fieldLabel>
<fieldValue>System_Time</fieldValue>
<fieldType>character</fieldType>
</userField>
<userField>
<fieldLabel>MainReturn</fieldLabel>
<fieldValue/>
<fieldType>character</fieldType>
</userField>
</SysStructure_FIELD>
</STRUCTURE_Fields>
</userField>
<userField>
<fieldLabel>Label</fieldLabel>
<fieldValue>Sys_Default_Structure</fieldValue>
<fieldType>character</fieldType>
</userField>
</STRUCTURE>
</STRUCTURESet>