sort - some fixes in my previous Q
hello
I am trying to feel according to an attribute name dbcolumn and I want to sort the response according to other attribute name order.
input file:
<entities>
<entity eid="A" tid="501" plural-tid="502" grouping-tid="503" plural-grouping-tid="504" length="256">
<display mandatory="yes" order="11"></display>
<data class="activity" type="varchar" dbcolumn="SERVICE_ID" mandatory="yes" last-summary="all" collection-id="service-id"></data>
</entity>
<entity eid="Q" tid="511" plural-tid="512" grouping-tid="513" plural-grouping-tid="514" length="256">
<display mandatory="no" order="31"></display>
<data class="user-defined" type="varchar" dbcolumn="HANDLER_TYPE" mandatory="no" last-summary="all" collection-id="handler-type"></data>
</entity>
<entity eid="C" tid="521" plural-tid="522" grouping-tid="523" plural-grouping-tid="524" length="256">
<display mandatory="no" order="22"></display>
<data class="user-defined" type="varchar" dbcolumn="CLASS_NAME" mandatory="no" last-summary="all" collection-id="class-name"></data>
</entity>
<entity eid="D" tid="531" plural-tid="532" grouping-tid="533" plural-grouping-tid="534" length="256">
<display mandatory="no" order="14"></display>
<data class="user-defined" type="varchar" dbcolumn="COMMAND_LINE" mandatory="no" last-summary="all" collection-id="command-line"></data>
</entity>
<entity eid="F" tid="551" plural-tid="552" grouping-tid="553" plural-grouping-tid="554" length="256">
<display mandatory="no" order="5"></display>
<data class="user-defined" type="varchar" dbcolumn="SERVER_PRODUCT" mandatory="no" last-summary="all" collection-id="server-product"></data>
</entity>
</entities>
xsl file that is working now
<case v2="">
<xsl:for-each select = "@dbcolumn">
<xsl:call-template name="apptier-graphs">
<xsl:with-param name="v1" select="concat('!~isGraphEnabled.', @dbcolumn, '!~')"/>
<xsl:with-param name="node" select="concat('/entity[@key=', $apos, 'common', $apos, ']/graphs/graph[@key=', $apos, @dbcolumn, $apos, ']')"/>
</xsl:call-template>
</xsl:for-each>
</case>
out put now:
<select v1="!~isGraphEnabled.SERVICE_ID!~">
<case v2="true">
<include import="this-I3-entity" node="/entity[@key='common']/graphs/graph[@key='SERVICE_ID']"/>
</case>
</select>
<select v1="!~isGraphEnabled.HANDLER_TYPE!~">
<case v2="true">
<include import="this-I3-entity" node="/entity[@key='common']/graphs/graph[@key='HANDLER_TYPE']"/>
</case>
</select>
<select v1="!~isGraphEnabled.CLASS_NAME!~">
<case v2="true">
<include import="this-I3-entity" node="/entity[@key='common']/graphs/graph[@key='CLASS_NAME']"/>
</case>
</select>
<select v1="!~isGraphEnabled.COMMAND_LINE!~">
<case v2="true">
<include import="this-I3-entity" node="/entity[@key='common']/graphs/graph[@key='COMMAND_LINE']"/>
</case>
</select>
<select v1="!~isGraphEnabled.SERVER_PRODUCT!~">
<case v2="true">
<include import="this-I3-entity" node="/entity[@key='common']/graphs/graph[@key='SERVER_PRODUCT']"/>
</case>
</select>
I would like to know how can I make the output sorted by the order attribute that I have in the input file?
I tried to use
<xsl:sort data-type="number" select="/etd/*/entity/display/@order"/>
but I believe that something is missing.
need help
thanks
|