CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2006
    Posts
    297

    [RESOLVED] Case insensitive string comparison with XSLT

    Right now I'm matching a case insensitive string like this. I'm wondering if there is an easier way to ignore case when comparing strings in an XSL transform file. I've looked everywhere this is the only way I've seen to do it. Seems there should be a more elegant solution.

    Code:
    translate(@type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz') = 'combobox2'

  2. #2
    Join Date
    Feb 2005
    Location
    Denmark
    Posts
    742

    Re: Case insensitive string comparison with XSLT

    Depending on which XSL engine you use, then you can perhaps utilize scripts in it.
    For example if using .NET you can do something like this: http://www.svelmoe.dk/post/Using-scripts-in-XSLT
    I suspect similar exists for Java.

    It is not the worlds most elegant solution to the problem, but using scripts in XSLT have solved many of my problems much more elegant and faster then otherwise.
    Last edited by Alsvha; January 28th, 2011 at 01:16 AM.

  3. #3
    Join Date
    Jul 2006
    Posts
    297

    Re: Case insensitive string comparison with XSLT

    Perfect, just what i was looking for, i love it thanks. Using .NET so wont be any problems using this example.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured