![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: XSL Sort >Thread Next - Re: XSL Sort Re: XSL SortTo: NULL Date: 6/19/2008 3:38:00 PM
Martin Honnen wrote:
> tamilselvi wrote:
>> The XML format is
>>
>> <Company Name="Tamil" Sortname="abc"/>
>> <Company Name="Tamils" Sortname="xyz"/>
>> <Company Name="ABCs" Sortname="Www"/>
>
> So you have attributes named 'Name' and 'Sortname'. Try whether
> <xsl:apply-templates select="Company">
> <xsl:sort select="@Name" data-type="text"/>
> <xsl:sort select="@Sortname" data-type="text"/>
> </xsl:apply-templates>
> does what you are looking for. That sorts on @Name first, then on
> @Sortname.
>
> If the above is not what you are looking for then you need to tell us
> exactly what kind of "null" values you have i.e. whether the attribute
> is not present or whether it has a special value indicating null.
Assuming "null" value means that the Name attribute is not present you
can use
<xsl:apply-templates select="Company">
<xsl:sort select="(@Name | @Sortname)[1]"/>
</xsl:apply-templates>
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
