sort on specific attribute
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="1"></display><data class="activity" type="varchar" dbcolumn="MAIL_MSG" mandatory="yes" last-summary="all" collection-id="msg"></data></entity>
<entity eid="U" tid="511" plural-tid="512" grouping-tid="513" plural-grouping-tid="514" length="256"><display mandatory="no" order="6"></display><data class="user_name" type="varchar" dbcolumn="SENDER" mandatory="yes" last-summary="all" collection-id="sender"></data></entity>
<entity eid="C" tid="521" plural-tid="522" grouping-tid="523" plural-grouping-tid="524" length="256"><display mandatory="no" order="7"></display><data class="client_ip" type="varchar" dbcolumn="SENDER_IP" mandatory="yes" last-summary="all" collection-id="C_IP"></data></entity>
<entity eid="T" tid="531" plural-tid="532" length="256"><display mandatory="no" order="9"></display><data class="user-defined" type="varchar" dbcolumn="MSG_TYPE" mandatory="yes" last-summary="all" collection-id="type"></data></entity>
<entity eid="I" tid="541" plural-tid="542" grouping-tid="543" plural-grouping-tid="544" length="256"><display mandatory="no" order="2"></display><data class="instance" type="varchar" mandatory="yes" last-ummary="all"></data></entity></entity></entities>
xsl file that is working now
<case v2="">
<xsl:for-each select = "$id-db_columns">
<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>
<xsl:call-template name="apptier-graphs">
<xsl:with-param name="v1" select="concat('!~isGraphEnabled.', $instance_column_name, '!~')"/>
<xsl:with-param name="node" select="concat('/entity[@key=', $apos, 'common', $apos, ']/graphs/graph[@key=', $apos, $instance_column_name, $apos, ']')"/>
</xsl:call-template>
<xsl:call-template name="apptier-graphs">
<xsl:with-param name="v1" select="concat('!~isGraphEnabled.', $server_column_name, '!~')"/>
<xsl:with-param name="node" select="concat('/entity[@key=', $apos, 'common', $apos, ']/graphs/graph[@key=', $apos, $server_column_name, $apos, ']')"/>
</xsl:call-template>
</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>
<select v1="!~isGraphEnabled.EXIT_CODE!~">
<case v2="true">
<include import="this-I3-entity" node="/entity[@key='common']/graphs/graph[@key='EXIT_CODE']"/>
</case>
</select>
<select v1="!~isGraphEnabled.REAL_COMMUNICATION!~">
<case v2="true">
<include import="this-I3-entity" node="/entity[@key='common']/graphs/graph[@key='REAL_COMMUNICATION']"/>
</case>
</select>
<select v1="!~isGraphEnabled.CLIENT_PRODUCT!~">
<case v2="true">
<include import="this-I3-entity" node="/entity[@key='common']/graphs/graph[@key='CLIENT_PRODUCT']"/>
</case>
</select>
<select v1="!~isGraphEnabled.CLIENT_HOST!~">
<case v2="true">
<include import="this-I3-entity" node="/entity[@key='common']/graphs/graph[@key='CLIENT_HOST']"/>
</case>
</select>
<select v1="!~isGraphEnabled.instance!~">
<case v2="true">
<include import="this-I3-entity" node="/entity[@key='common']/graphs/graph[@key='instance']"/>
</case>
</select>
<select v1="!~isGraphEnabled.SERVER!~">
<case v2="true">
<include import="this-I3-entity" node="/entity[@key='common']/graphs/graph[@key='SERVER']"/>
</case>
</select>
I would like to know how will I make the output sorted by the order attribute that I have in the input file and not change the schema of the xsl file?
thanks
|