Topic
7 replies Latest Post - ‏2013-01-04T14:25:11Z by Nivast
Nivast
Nivast
25 Posts
ACCEPTED ANSWER

Pinned topic Datapower-XSLT help -lowercase convertion

‏2013-01-03T22:14:07Z |
Hi ,

Any one can you please help me on this?

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dp="http://www.datapower.com/extensions" xmlns:regExp="http://exslt.org/regular-expressions" extension-element-prefixes="dp regExp" exclude-result-prefixes="dp regExp">
<xsl:output method="xml"/>
<xsl:template match="/">
<xsl:variable name="test">
<xsl:value-of select="('TEST CONVERTION to Lower Case')"/>
</xsl:variable>
<xsl:value-of select="lower-case($test)"/>
</xsl:template>
</xsl:stylesheet>

when i exceuted directly from XML SPY i am able to convert the value to lower case but same code its not working in Datapower.

Is iam missing any DP extentions?
Updated on 2013-01-04T14:25:11Z at 2013-01-04T14:25:11Z by Nivast
  • Liv2luv
    Liv2luv
    573 Posts
    ACCEPTED ANSWER

    Re: Datapower-XSLT help -lowercase convertion

    ‏2013-01-03T22:21:20Z  in response to Nivast
    upper-case() and lower-case() are XSLT 2.0 functions.

    try this for case conversion http://stackoverflow.com/questions/586231/how-can-i-convert-a-string-to-upper-or-lower-case-with-xslt
    • Nivast
      Nivast
      25 Posts
      ACCEPTED ANSWER

      Re: Datapower-XSLT help -lowercase convertion

      ‏2013-01-04T02:32:25Z  in response to Liv2luv
      Thank you.The above link already tried and working but why its not working lower-case and upper-case funtions are not working in XSLT v2.0 in Datapower?If any idea please let me know.
      • SystemAdmin
        SystemAdmin
        6772 Posts
        ACCEPTED ANSWER

        Re: Datapower-XSLT help -lowercase convertion

        ‏2013-01-04T02:48:34Z  in response to Nivast
        DataPower doesn't yet support XSLT 2.0.
        It's been on the wish list for years. We're still waiting ;)
        • SystemAdmin
          SystemAdmin
          6772 Posts
          ACCEPTED ANSWER

          Re: Datapower-XSLT help -lowercase convertion

          ‏2013-01-04T13:55:09Z  in response to SystemAdmin
          You may want to use the translate function.

          code{
          <xsl:when test="$Somevalue = 'upper'"> <xsl:value-of select="translate($string,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
          </xsl:when>
          <xsl:when test="$Somevalue = 'lower'"> <xsl:value-of select="translate($string,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
          </xsl:when>

          }

          Thanks!
          Salla
          • SystemAdmin
            SystemAdmin
            6772 Posts
            ACCEPTED ANSWER

            Re: Datapower-XSLT help -lowercase convertion

            ‏2013-01-04T13:57:22Z  in response to SystemAdmin
            oops ignore "code{" and "}"
            lost the track of putting the code :P

            Thanks!
            Salla
            • SystemAdmin
              SystemAdmin
              6772 Posts
              ACCEPTED ANSWER

              Re: Datapower-XSLT help -lowercase convertion

              ‏2013-01-04T13:58:30Z  in response to SystemAdmin
              figured Suresh has posted this too :P.

              Thanks!
              Salla
              • Nivast
                Nivast
                25 Posts
                ACCEPTED ANSWER

                Re: Datapower-XSLT help -lowercase convertion

                ‏2013-01-04T14:25:11Z  in response to SystemAdmin
                Thank you Nick for the answer.
                Thanks for everyone help.