Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Evan 344 posts 99 karma points
    Feb 25, 2009 @ 20:27
    Evan
    0

    Convert uppercase letters to lower case...

    I need to convert my uppercase letters to lowercase, here is my xslt so far:

    ]>
    <>
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library"
    exclude-result-prefixes="msxml umbraco.library">










    I need to somehow use the translate() function on the call. How can I do this? Every time i try i get an error opening the xslt. Any help would be greatly appreciated

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Feb 25, 2009 @ 21:04
    Peter Dijksterhuis
    0

    You should move the 2 variables to the top (lcletters and ucletters), place them just below the output method.
    Then, do the translate on your pageTitle.
    The error was probably because you tried to use a variable which was not known at that point yet.

    HTH,
    PeterD

  • Tommy Poulsen 514 posts 708 karma points
    Feb 25, 2009 @ 21:45
    Tommy Poulsen
    0

    ... or you could use the Exslt.ExsltStrings:lowercase() and similar uppercase()
    library function. You can see available extensions if you click "Insert value-of" button, and click the "Get Extensions" button.

    Tommy

  • Evan 344 posts 99 karma points
    Feb 25, 2009 @ 21:48
    Evan
    0

    [quote=PeterD]You should move the 2 variables to the top (lcletters and ucletters), place them just below the output method.
    Then, do the translate on your pageTitle.
    The error was probably because you tried to use a variable which was not known at that point yet.

    HTH,
    PeterD[/quote]
    How can I call the translate on the value of the pagetitle?

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Feb 25, 2009 @ 22:04
    Peter Dijksterhuis
    0

  • Petr Snobelt 923 posts 1535 karma points
    Feb 26, 2009 @ 06:31
    Petr Snobelt
    0

    Isn't easyest use css text-transform ;-)

    Petr

  • rich hamilton 117 posts 136 karma points
    Mar 01, 2012 @ 11:24
    rich hamilton
    0

    I also want to do this to convert the page title to lowercase and replace spaces with dashed to create a class for the page.

    i.e. Our Products

    to <div class="our-products">...

     

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Mar 01, 2012 @ 11:48
    Chriztian Steinmeier
    0

    Hi Rich,

    There's an attribute you can use for that - the @urlName is very good for classname/ids, e.g.:

    <!-- Inside a <xsl:for-each> -->
    <div class="{@urlName}">
    
    <!-- Inside root (/) template -->
    <div class="$currentPage/@urlName">

    /Chriztian

  • Streety 358 posts 568 karma points
    Mar 01, 2012 @ 11:59
    Streety
    1

    Why are you doing this in XSLT?

    Why don't you create a new class in CSS:

    .toUpper {text-transform:uppercase;}

     

    or call the class in jQuery

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Mar 01, 2012 @ 12:14
    Chriztian Steinmeier
    0

    This question has branched into two different questions, actually - AFAIK the original question was something that was easier (and probably more 'correct' in markup terms) to use CSS for, e.g. when you want a headline in all caps.

    The second question (added today) is actually something different - wanting to add a valid classname that's derived from the @nodeName (or pageName), which there can be perfectly valid reasons to.

    In all cases - this thread should really be closed, so we don't end up with multiple differing questions ...

    /Chriztian

Please Sign in or register to post replies

Write your reply to:

Draft