Topic
  • 11 replies
  • Latest Post - ‏2014-09-01T11:29:55Z by HermannSW
Nivast
Nivast
25 Posts

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

    Re: Datapower-XSLT help -lowercase convertion

    ‏2013-01-03T22:21:20Z  
    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

    Re: Datapower-XSLT help -lowercase convertion

    ‏2013-01-04T02:32:25Z  
    • Liv2luv
    • ‏2013-01-03T22:21:20Z
    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
    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

    Re: Datapower-XSLT help -lowercase convertion

    ‏2013-01-04T02:48:34Z  
    • Nivast
    • ‏2013-01-04T02:32:25Z
    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.
    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

    Re: Datapower-XSLT help -lowercase convertion

    ‏2013-01-04T13:55:09Z  
    DataPower doesn't yet support XSLT 2.0.
    It's been on the wish list for years. We're still waiting ;)
    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

    Re: Datapower-XSLT help -lowercase convertion

    ‏2013-01-04T13:57:22Z  
    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
    oops ignore "code{" and "}"
    lost the track of putting the code :P

    Thanks!
    Salla
  • SystemAdmin
    SystemAdmin
    6772 Posts

    Re: Datapower-XSLT help -lowercase convertion

    ‏2013-01-04T13:58:30Z  
    oops ignore "code{" and "}"
    lost the track of putting the code :P

    Thanks!
    Salla
    figured Suresh has posted this too :P.

    Thanks!
    Salla
  • Nivast
    Nivast
    25 Posts

    Re: Datapower-XSLT help -lowercase convertion

    ‏2013-01-04T14:25:11Z  
    figured Suresh has posted this too :P.

    Thanks!
    Salla
    Thank you Nick for the answer.
    Thanks for everyone help.
  • hartl
    hartl
    8 Posts

    Re: Datapower-XSLT help -lowercase convertion

    ‏2014-08-28T11:50:55Z  
    • Liv2luv
    • ‏2013-01-03T22:21:20Z
    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

    i have the same problem. Afaik those are XPATH 2.0 functions, and datapower should support XPATH 2.0 since firmware version 6.0.0.0

    But still it doesn't work. Any hints?

     

  • HermannSW
    HermannSW
    4647 Posts

    Re: Datapower-XSLT help -lowercase convertion

    ‏2014-08-28T15:03:00Z  
    • hartl
    • ‏2014-08-28T11:50:55Z

    i have the same problem. Afaik those are XPATH 2.0 functions, and datapower should support XPATH 2.0 since firmware version 6.0.0.0

    But still it doesn't work. Any hints?

     

    DataPower 6.0.0.0 and later firmware DOES support XPath 2.0, but in the XQuery processor, not in the XSLT processor.
    See this posting for details and interesting application (XPath 1.0 and XPath 2.0 in a single (concat) statement):
    https://www.ibm.com/developerworks/community/blogs/HermannSW/entry/xpath_1_0_and_xpath_2_0_in_a_single_concat_statement

    Here you can see that lower-case() works

    • without problems
    • also for Non-ASCII characters (German Umlaute äöü)
    $ echo "<s>HÜHNERVÖGELHÄUSER</s>" | coproc2 lower-case.xq - http://dp2-l3:2225 ; echo
    hühnervögelhäuser
    $ 
    $ cat lower-case.xq 
    lower-case(.)
    $
    

     

    Hermann <myBlog/> <myTweets/> | <GraphvizFiddle/> | <xqib/> | <myCE/> <myFrameless/> | 

    Updated on 2014-08-28T15:07:42Z at 2014-08-28T15:07:42Z by HermannSW
  • hartl
    hartl
    8 Posts

    Re: Datapower-XSLT help -lowercase convertion

    ‏2014-09-01T11:01:43Z  
    • HermannSW
    • ‏2014-08-28T15:03:00Z

    DataPower 6.0.0.0 and later firmware DOES support XPath 2.0, but in the XQuery processor, not in the XSLT processor.
    See this posting for details and interesting application (XPath 1.0 and XPath 2.0 in a single (concat) statement):
    https://www.ibm.com/developerworks/community/blogs/HermannSW/entry/xpath_1_0_and_xpath_2_0_in_a_single_concat_statement

    Here you can see that lower-case() works

    • without problems
    • also for Non-ASCII characters (German Umlaute äöü)
    <pre class="javascript dw" data-editor-lang="js" data-pbcklang="javascript" dir="ltr">$ echo "<s>HÜHNERVÖGELHÄUSER</s>" | coproc2 lower-case.xq - http://dp2-l3:2225 ; echo hühnervögelhäuser $ $ cat lower-case.xq lower-case(.) $ </pre>

     

    Hermann <myBlog/> <myTweets/> | <GraphvizFiddle/> | <xqib/> | <myCE/> <myFrameless/> | 

    Thank you Hermann, i will try to use that.

    Are there plans to have XSLT support XPath 2.0 directly?

  • HermannSW
    HermannSW
    4647 Posts

    Re: Datapower-XSLT help -lowercase convertion

    ‏2014-09-01T11:29:55Z  
    • hartl
    • ‏2014-09-01T11:01:43Z

    Thank you Hermann, i will try to use that.

    Are there plans to have XSLT support XPath 2.0 directly?

    Hi,

    support for XPath 2.0 in XSLT directly [without dp:xquery-transform(_, _)] would be available in XSLT 2.0 or XSLT 3.0. I am not allowed to do any future looking statements, only product management can do that.

    I did not find an XSLT 2.0(3.0) RFE, perhaps you may want to create one?
    http://www.ibm.com/developerworks/rfe/



    Hermann <myBlog/> <myTweets/> | <GraphvizFiddle/> | <xqib/> | <myCE/> <myFrameless/> |