Skip to Content
author's profile photo Former Member
Former Member

Sorting on specific field using XSLT Mapping

Hi All,

I am trying to sort the records on specific field using XSLT mapping.But I'm unable get the proper output for the following code.

http://www.w3.org/1999/XSL/Transform" xmlns:a="http://xxxxxxxx">

<xsl:output method="xml" indent="yes" />

<xsl:template match="/">

<a:T1>

<Row>

<xsl:for-each select="a:S1/Record">

<xsl:sort select="EmpID" />

<EMPID>

<xsl:value-of select="EmpID"/>

</EMPID>

<ENAME>

<xsl:value-of select="EmpName"/>

</ENAME>

</xsl:for-each>

</Row>

</a:T1>

</xsl:template>

</xsl:stylesheet>>

Currently getting following output :

http://www.flickr.com/photos/21390012@N04/2074799747/

Expected output should be like below :

http://www.flickr.com/photos/21390012@N04/2074807393/

Kindly send me suggestion to achieve this.

Regards

Pullarao

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 30, 2007 at 07:22 AM

    Hi,

    Can u paste ur desired output and what u r getting here on SDN.I am not able to see it thru those links.

    Regards,

    Anoop

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 30, 2007 at 07:42 AM

    please go through the blog

    /people/tobias.trapp/blog/2007/08/12/smartform-generation-using-advanced-abap-xslt-techniques

    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/03b9d190-0201-0010-1994-e51c28c129d3

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 30, 2007 at 10:13 AM

    Hi ,

    I donno much about srting in XSLT but i can give you one example on that.

    Example :

    This is how to sort numbers in xslt.

    Try this :

    <xsl:for-each select="learn[@kind='done']">

    <xsl:sort select="number(@rank)" data-type="number"/>

    <table border="00" cellpadding="3" width="100%">

    <tr>

    <td width="100" valign="top" align="right"><input type="checkbox" checked="checked" readonly="readonly"/></td>

    <td width="10" valign="top" align="right"><xsl:value-of select="position()"/>. </td>

    <td valign="top">

    [<xsl:value-of select="@rank"/>] <xsl:value-of select="@title"/>

    </td>

    </tr>

    </table>

    <table border="00" cellpadding="3" width="100%">

    <tr>

    <td width="100"> </td>

    <td valign="top">

    <xsl:apply-templates/>

    </td>

    </tr>

    </table>

    </xsl:for-each>

    Regards

    Aashish Sinha

    PS : reward points if helpful

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.