cancel
Showing results for 
Search instead for 
Did you mean: 

Expression Editor

Former Member
0 Kudos

Hi Everyone ,

In the link editor , we have the expression editor for entering expressions to assign a value to a target xpath.

I would like to know the actual code behind it , like the platform and technology used.

I tried some xpath functions , among them few are working and remaining are not. Apart from the standard functions provided in it , I would like to explore much more functions that can be used in Expression editor to reduce the transaction size and improve its performance.

Simply it is like the background process ,How the expressions entered in the Expression editor are accessed and what kind of operations are performed ?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Kedar ,

I tried count() , sum() and avg() functions among which avg() is not working .

Some other functions like remove() is also not working.

Hence , I got confused and I wanna get a clear Idea about it.

Former Member
0 Kudos

Hi Sravan,

Is your problem resolved?

Have you gone through the list of Expression Editor functions? It has "average(value1, value2)" function available.

Best Regards,

Kedar

Former Member
0 Kudos

Hi Kedar ,

Thanks for your response.

My problem is not with average or sum function. I know some functions are available in MII expression editor but to make use of XPATH functions and JAVA features as these are the background coding for MII I would like to know why only some of those XPATH functions are showing results and some are not.

I'm trying this to make my applications optimized in terms of performance and size.

If you know the reason , please tell me.

erik_schrampf
Active Participant
0 Kudos

Sravan,

All of these xPath functions work as I have used them in transactions using the expression editor. For example the syntax for count would be Document_0.Output{count(/Rowsets/Rowset/Row)}. The same would be true for Sum or some of the other ones you mentioned depending on what you exactly you want. This example provided will give you the count for the whole dataset/document.

Erik

Former Member
0 Kudos

Hi Sravan,

I'm not sure if the current version of MII supports the XPath 2.0 standard. The sum and count functions work, but as you stated, the avg function does not. Still, with the many functions MII provides, you should be able to accomplish what you need.

Kind Regards,

Diana Hoppe

Former Member
0 Kudos

Hi Sravan,

XPath 1.0 does not support "avg" function. XPath 2.0 does support this function.

Have a look at below links:

http://www.edankert.com/xpathfunctions.html

http://www.w3.org/TR/xpath-functions/

As far as my knowledge goes, MII 1.5 onwards uses XPath 2.0 functions.

Hope this helps!

Best Regards,

Kedar

Former Member
0 Kudos

Hi Sravan,

I like your idea to improve performance by purposeful use of XPath functions in MII.

In addition to what Diana said you can use a combination of functions that work to "workaround" functions that do not work. For your two examples, the following construct works in MII:


instead of avg(), use
Local.TestXML{sum(/Rowsets/Rowset/Row/MyNode) div count(/Rowsets/Rowset/Row/MyNode)}

instead of remove(), use
Local.TestXML{/Rowsets/Rowset/Row[position() != 1]/One}  (e.g. in a repeater to avoid row 1)

Michael

Former Member
0 Kudos

Hi Sravan,

Please find the below links that will help you in finding all the Expression Editor functions and operators.

http://wbhelp.sap.com/manufacturing/xmii_120/en/45/bf7f3b692f52f5e10000000a1553f7/content.htm

http://wbhelp.sap.com/manufacturing/xmii_120/en/46/c0a6f77a501824e10000000a1553f6/content.htm

I tried almost all of them and they worked fine for me.

Asfar as my knowledge goes, the editor is developed in Java/J2EE.

Which XPATH functions you tried?

Please refer to the next link for some examples: http://www.w3schools.com/xpath/xpath_examples.asp

Hope it helps.

Best Regards,

Kedar