sort by : insensitive case

i have the following problem :

declare namespace ctxC=‘contractX/contractX’ declare namespace ctxP=‘contractX/contractXParty’ declare namespace ctxPers=‘contractX/contractXPerson’ declare namespace ctxCD=‘contractX/contractXDraft’ declare namespace ctxN=‘contractX/contractXNotification’ declare namespace ctxO=‘contractX/contractXOrganisation’ declare namespace ctxCS=‘contractX/contractXContractStatus’ declare namespace ctxRQ=‘contractX/contractXReportQueries’ declare namespace tf=‘http://namespaces.softwareag.com/tamino/TaminoFunction’ declare namespace xf=‘W3C XQuery 1.0 and XPath 2.0 Functions and Operators’ declare namespace dc=‘http://purl.org/dc/elements/1.1/’ declare namespace office=‘http://openoffice.org/2000/office’ declare namespace ctxNX=‘contractX/contractNonXml’ declare namespace xs=‘http://www.w3.org/2001/XMLSchema’ for $party in ( input()/:contractXParty) where (‘a’) =‘a’ return {data($party/:PartyDetails/:PartyReferenceDetails/:PartyInternalNumber)}{data($party/:PartyDetails/:PartyName)}{data($party/:PartyDetails/:PartyReferenceDetails/:PartyTypeCode)}{data($party/:PartyDetails/:PartyAddressDetails/:AddressCityName)}{data($party/:PartyDetails/:PartyAddressDetails/*:AddressCountryCode)} sort by(name)

sort first number, then uppercase and finally lowercase. how make a insensitive case sorting ?

Hi,

Since Tamino XQuery does not support the fn:upper-case() or fn:lower-case() function you have to specify an according default collation to perform a case-insensitive sort. An example query looks like:

declare default collation “collation?language=en;strength=secondary”

(“a”,“B”) sort by (.)

The result of the query is:

xq:valuea</xq:value>
xq:valueB</xq:value>

This also works if the input strings contain digits. The following query

declare default collation “collation?language=en;strength=secondary”

(“a”,“1a”,“B”) sort by (.)

Gives the result:

xq:value1a</xq:value>
xq:valuea</xq:value>
xq:valueB</xq:value>


Please note that the default collation support in XQuery has been introduced with Tamino 4.2.

Best regards,

Thorsten Fiebig