Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: XSL Sort [Thread Next] Re: XSL SortTo: NULL Date: 6/20/2008 1:30:00 PM tamilselvi wrote: > <xsl:apply-templates select="Company"> > <xsl:sort select="(@Name | @Sortname[not(../@Name)])[1]"/> > </xsl:apply-templates> > > Its working fine. > Can u explain this concept <xsl:sort select="(@Name | @Sortname[not(../@Name)])[1]"/> can be further simplified to <xsl:sort select="(@Name | @Sortname[not(../@Name)])"/> The '|' is the union operator so what you do is taking the union of the 'Name' attribute and the 'Sortname' attribute not having a parent with a 'Name' attribute. That way you ensure that, if the 'Name' attribute is present, you sort on the 'Name' attribute, and if 'Name' is not present, then you sort on the 'Sortname' attribute. -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
