[xsl] order on lookup values.

Subject: [xsl] order on lookup values.
From: Khalid Ansari <KhalidAn@xxxxxxxxx>
Date: Wed, 19 Sep 2007 09:35:39 -0700 (PDT)
I have a lookup xml which contains both description and filed names for each
error code in my source xml.



        <Description>Invalid action








I process following xml with XSL to combine errorcodes,
descriptions and fieldnames.














and following is my xsl
<xsl:key name="code-lookup" match="Code" use="ErrorCodes"/>

name="codes-top" select="document("codes.xml")/Codes"/>
<xsl:template match="SystemError">

       <xsl:text> Error : </xsl:text>
<xsl:value-of select="ErrorCode"/>

               <xsl:text> means

                    <xsl:apply-templates select="$codes-top">
<xsl:with-param name="curr-errorcode" select="ErrorCode"/>





        <xsl:param name="curr-errorcode"/>
<xsl:variable name="tempError" select="normalize-space($curr-errorcode)"/>
<xsl:variable name="tempMsg" select="key('code-lookup',

        <xsl:variable name="fieldName"
select="key('code-lookup', $tempError)/Field"/>
<xsl:value-of select="$tempMsg"/> 

       <xsl:text> : Field Name :
</xsl:text><xsl:value-of select="$fieldName"/>


Currently I
am getting outputs like:

Error: Error1 means Invalid action indicator :
Field Name : actionIndicator

Error: Error2 means Invalid user : Field Name :

But I need to get output as following.

Error: Error1 means Invalid
action indicator 

Error: Error2 means Invalid user

Field Names:


I tried different approaches but none worked for
me.  Can someone help me please.
Khalid Ansari
Catch up on fall's hot new shows on Yahoo! TV. Watch previews, get
listings, and more!

Current Thread