spring-projects / spring-integration

Spring Integration provides an extension of the Spring programming model to support the well-known Enterprise Integration Patterns (EIP)
http://projects.spring.io/spring-integration/
Apache License 2.0
1.55k stars 1.11k forks source link

Document combination of SpEL and XPath expressions [INT-1917] #5903

Closed spring-operator closed 11 years ago

spring-operator commented 13 years ago

Džiugas Baltrūnas opened INT-1917 and commented

There is no explanation in documentation about combination of SpEL and XPath expressions, i.e. what constructs are possible and how they should be used.


Affects: 2.0.4

This issue is a sub-task of #6138

Issue Links:

spring-operator commented 13 years ago

Mark Fisher commented

Can you please provide a bit more detail about the particular area where you'd like to see clarification? Is it the comparison of a plain header-enricher with "expression" attributes compared to the xpath-header-enricher? Something else?

spring-operator commented 13 years ago

Džiugas Baltrūnas commented

The main question is "how it actually works", since we talk about two different expression languages, so from the first sight it's unclear how can they be mixed together. In particular, I think following questions should be explained:

1) In what context (xpath-expression, xpath-header-enricher) mixing of SpEL and XPath expressions is allowed; 2) More examples (the only one is expression="/person/@age * 2"); 3) Syntax, context, scope, features and limitations, i.e. are constructs like "new String(/person/@age).length()" possible or not and if is, how ApplicationContext's @bean is separated from XML @attribute (syntax collisions).

By the way, xpath-header-enricher is undocumented either, I've added a comment to #5174.

Thanks, Džiugas

spring-operator commented 13 years ago

Gunnar Hillert commented

Documentation for #6118 will be done on the same Git branch #5903

spring-operator commented 13 years ago

Gunnar Hillert commented

Just issued pull request: https://github.com/SpringSource/spring-integration/pull/142 as part of the parent issue.

As it turns out this was a documentation error. Spring Integration XPath Expressions do NOT presently support SpEL. I removed the respective reference from the Reference Manual.

If there is an urgent request to provide SpEL support for XPath Expressions, please open a separate Jira issue.

spring-operator commented 11 years ago

Jeffrey R Phillips commented

Did the ability to use SpEL and XPath together ever get added to Spring Integration? My scenerio is I have an xml value the form 123456-234343, I need to strip off the first part of the value in a header enricher. I need to use XPath to get to the value, then SpEL to do the string manipulations.

Thanks!

spring-operator commented 11 years ago

Artem Bilan commented

Here, please: #7052 Will be done soon. However you can do it on your own now with new SpEL functions support from SI 3.0.M3