cancel
Showing results for 
Search instead for 
Did you mean: 

XSL Mapping: How to make a "max()" function

Former Member
0 Kudos

Hi all,

In XSL 2.0 we have many usefull functions, like max, avg, etc... Is there a way to implement this kind of functions in XI? We are using XI 3.0 with WAS 7.

Thansk!

roberti

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can use this in XSLT mapping and condition editor

Regards

Vijaya

Former Member
0 Kudos

Thanks for your reply,

I'm talking about XSL Mapping. I know we have many functions (and the possibility of creating new functions with Java) in XI Mapping, but I have a very complex message, with many xsd:anyType in the schema.

First, I couldn'd find a way to use xsd:anyTupe in XI DataTypes. So, I couldn't use XI Mapping.

Second, I made a XSL Mapping. In this mapping, I need to get the maximum value from an atribute.

With XSLT tools that support XSL 2.0 I can use the xsl:max function. But I think that XI doesn't support XSL 2.0, only 1.0 functions work properly.

So, I would like to ask you if some of you know a way to make a "max" function with xsl 1.0, or, if some of you have an idea on how to make XI "understand" xsl 2.0.

Vijaya, what is "XSLT mapping and condition editor". Where can I find it?

Thanks!

roberti

Former Member
0 Kudos

Hi,

From SAP:

<i>Below is a description of one of the ways that the SAP J2EE Engine supports the XML Toolkit 2.0.</i>

http://help.sap.com/saphelp_nw04/helpdata/en/55/7ef3003fc411d6b1f700508b5d5211/content.htm

Regards

Vijaya

Former Member
0 Kudos

Hi all,

I've found a solution to the problem! Look at this:

<xsl:for-each select="/element/@attribute">

<xsl:sort data-type="number" order="descending" />

<xsl:if test="position() = 1">

<xsl:value-of select="number(.)" />

</xsl:if>

</xsl:for-each>

This does almost the same that a MAX function in XSL 2.0 do. It gets the major value in the node "element" for the "attribute".

thanks for your trying!

cheers!

roberti

Former Member
0 Kudos

Hi all,

I've found a solution to the problem! Look at this:

<xsl:for-each select="/element/@attribute">

<xsl:sort data-type="number" order="descending" />

<xsl:if test="position() = 1">

<xsl:value-of select="number(.)" />

</xsl:if>

</xsl:for-each>

This does almost the same that a MAX function in XSL 2.0 do. It gets the major value in the node "element" for the "attribute".

thanks for your trying!

cheers!

roberti

Former Member
0 Kudos

Hi all,

I've found a solution to the problem! Look at this:

<xsl:for-each select="/element/@attribute">

<xsl:sort data-type="number" order="descending" />

<xsl:if test="position() = 1">

<xsl:value-of select="number(.)" />

</xsl:if>

</xsl:for-each>

This does almost the same that a MAX function in XSL 2.0 do. It gets the major value in the node "element" for the "attribute".

thanks for your trying!

cheers!

roberti

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Roberti,

There are predefined function in the Message Mapping tool within the XI, also you can create your own Java function in the messaging tool itself.

Thanks & Regards,

Farooq Farooqui.

Former Member
0 Kudos

Hi ,

In XI you can use Min , max etc functions in message mapping under arthimetic functions ( all the functions are like a node in mapping ).

Nanda

Message was edited by: Nanda kishore Reddy Narapu Reddy