This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch camel-3.11.x in repository https://gitbox.apache.org/repos/asf/camel.git
commit eb52ca0239708162d6abf7a972e7cb92cb3144c0 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Tue Aug 17 10:47:33 2021 +0200 Polish and cleanup documentation --- .../src/main/docs/datasonnet-language.adoc | 13 +++++++--- .../src/main/docs/groovy-language.adoc | 15 ++++++----- .../src/main/docs/xquery-component.adoc | 7 +----- .../camel-saxon/src/main/docs/xquery-language.adoc | 13 +++++----- .../camel-xpath/src/main/docs/xpath-language.adoc | 29 ++++++++++++++++------ 5 files changed, 49 insertions(+), 28 deletions(-) diff --git a/components/camel-datasonnet/src/main/docs/datasonnet-language.adoc b/components/camel-datasonnet/src/main/docs/datasonnet-language.adoc index 39eece1..03e8085 100644 --- a/components/camel-datasonnet/src/main/docs/datasonnet-language.adoc +++ b/components/camel-datasonnet/src/main/docs/datasonnet-language.adoc @@ -9,13 +9,20 @@ include::{cq-version}@camel-quarkus:ROOT:partial$reference/languages/datasonnet. *Since Camel {since}* -Camel supports https://datasonnet.com/[DataSonnet] transformations to allow an Expression or Predicate to be used in the Java DSL or xref:manual::xml-configuration.adoc[XML -Configuration]. +Camel supports https://datasonnet.com/[DataSonnet] transformations to allow an +xref:manual::expression.adoc[Expression] or xref:manual::predicate.adoc[Predicate] to be +used in the xref:manual::dsl.adoc[DSL]. + +For example you could use DataSonnet to create an +Predicate in a xref:{eip-vc}:eips:filter-eip.adoc[Message +Filter] or as an Expression for a +xref:{eip-vc}:eips:recipientList-eip.adoc[Recipient List]. To use a DataSonnet expression use the following Java code: + [source,java] --------------------------------------- -... datasonnet("someDSExpression") ... +datasonnet("someDSExpression") --------------------------------------- == DataSonnet Options diff --git a/components/camel-groovy/src/main/docs/groovy-language.adoc b/components/camel-groovy/src/main/docs/groovy-language.adoc index 40ba5fa..5f489f2 100644 --- a/components/camel-groovy/src/main/docs/groovy-language.adoc +++ b/components/camel-groovy/src/main/docs/groovy-language.adoc @@ -9,17 +9,20 @@ include::{cq-version}@camel-quarkus:ROOT:partial$reference/languages/groovy.adoc *Since Camel {since}* -Camel supports http://groovy.codehaus.org/[Groovy] among other -Scripting Languages to allow an -Expression or Predicate to be -used in the DSL or xref:manual::xml-configuration.adoc[Xml -Configuration]. +Camel supports http://www.groovy-lang.org/[Groovy] to allow an +xref:manual::expression.adoc[Expression] or xref:manual::predicate.adoc[Predicate] to be +used in the xref:manual::dsl.adoc[DSL]. + +For example you could use Groovy to create an +Predicate in a xref:{eip-vc}:eips:filter-eip.adoc[Message +Filter] or as an Expression for a +xref:{eip-vc}:eips:recipientList-eip.adoc[Recipient List]. To use a Groovy expression use the following Java code [source,java] --------------------------------------- -... groovy("someGroovyExpression") ... +groovy("someGroovyExpression") --------------------------------------- For example you could use the *groovy* function to create an diff --git a/components/camel-saxon/src/main/docs/xquery-component.adoc b/components/camel-saxon/src/main/docs/xquery-component.adoc index 51e61b0..1e5052a 100644 --- a/components/camel-saxon/src/main/docs/xquery-component.adoc +++ b/components/camel-saxon/src/main/docs/xquery-component.adoc @@ -12,12 +12,7 @@ include::{cq-version}@camel-quarkus:ROOT:partial$reference/components/xquery.ado *{component-header}* -Camel supports http://www.w3.org/TR/xquery/[XQuery] to allow an -Expression or Predicate to be -used in the DSL or xref:manual::xml-configuration.adoc[Xml -Configuration]. For example you could use XQuery to create an -Predicate in a xref:{eip-vc}:eips:filter-eip.adoc[Message -Filter] or as an Expression for a Recipient List. +Camel supports http://www.w3.org/TR/xquery/[XQuery] component for message transformation == Options diff --git a/components/camel-saxon/src/main/docs/xquery-language.adoc b/components/camel-saxon/src/main/docs/xquery-language.adoc index 44a5668..76ccd4c 100644 --- a/components/camel-saxon/src/main/docs/xquery-language.adoc +++ b/components/camel-saxon/src/main/docs/xquery-language.adoc @@ -10,12 +10,13 @@ include::{cq-version}@camel-quarkus:ROOT:partial$reference/languages/xquery.adoc *Since Camel {since}* Camel supports http://www.w3.org/TR/xquery/[XQuery] to allow an -Expression or Predicate to be -used in the DSL or xref:manual::xml-configuration.adoc[Xml -Configuration]. For example you could use XQuery to create an +xref:manual::expression.adoc[Expression] or xref:manual::predicate.adoc[Predicate] to be +used in the xref:manual::dsl.adoc[DSL]. + +For example you could use XQuery to create an Predicate in a xref:{eip-vc}:eips:filter-eip.adoc[Message Filter] or as an Expression for a -Recipient List. +xref:{eip-vc}:eips:recipientList-eip.adoc[Recipient List]. == XQuery Language options @@ -116,7 +117,7 @@ attribute: [source,xml] ------------------------------------------------------------------------------- - <xquery type="java.lang.String">concat('mock:foo.', /person/@city)</xquery> +<xquery type="java.lang.String">concat('mock:foo.', /person/@city)</xquery> ------------------------------------------------------------------------------- == Learning XQuery @@ -153,7 +154,7 @@ If you use maven you could just add the following to your pom.xml, substituting the version number for the latest & greatest release (see the download page for the latest versions). -[source,java] +[source,xml] -------------------------------------- <dependency> <groupId>org.apache.camel</groupId> diff --git a/components/camel-xpath/src/main/docs/xpath-language.adoc b/components/camel-xpath/src/main/docs/xpath-language.adoc index 0f7f627..b1a9768 100644 --- a/components/camel-xpath/src/main/docs/xpath-language.adoc +++ b/components/camel-xpath/src/main/docs/xpath-language.adoc @@ -10,12 +10,13 @@ include::{cq-version}@camel-quarkus:ROOT:partial$reference/languages/xpath.adoc[ *Since Camel {since}* Camel supports http://www.w3.org/TR/xpath[XPath] to allow an -Expression or Predicate to be -used in the DSL or xref:manual::xml-configuration.adoc[Xml -Configuration]. For example you could use XPath to create an +xref:manual::expression.adoc[Expression] or xref:manual::predicate.adoc[Predicate] to be +used in the xref:manual::dsl.adoc[DSL]. + +For example you could use XPath to create an Predicate in a xref:{eip-vc}:eips:filter-eip.adoc[Message Filter] or as an Expression for a -Recipient List. +xref:{eip-vc}:eips:recipientList-eip.adoc[Recipient List]. *Streams* @@ -228,14 +229,14 @@ shown: == Examples Here is a simple -https://github.com/apache/camel/blob/main/camel-core/src/test/java/org/apache/camel/processor/XPathFilterTest.java[example] +https://github.com/apache/camel/blob/main/core/camel-core/src/test/java/org/apache/camel/processor/XPathFilterTest.java[example] using an XPath expression as a predicate in a Message Filter If you have a standard set of namespaces you wish to work with and wish to share them across many different XPath expressions you can use the NamespaceBuilder as shown -https://github.com/apache/camel/blob/main/camel-core/src/test/java/org/apache/camel/processor/XPathWithNamespaceBuilderFilterTest.java[in +https://github.com/apache/camel/blob/main/core/camel-core/src/test/java/org/apache/camel/processor/XPathWithNamespaceBuilderFilterTest.java[in this example] In this sample we have a choice construct. The first choice evaulates if @@ -497,6 +498,20 @@ eg to refer to a file on the classpath you can do: == Dependencies -The XPath language is part of camel-core. +To use XPath in your camel routes you need to add the a dependency on +*camel-xpath* which implements the XPath language. + +If you use maven you could just add the following to your pom.xml, +substituting the version number for the latest & greatest release (see +the download page for the latest versions). + +[source,xml] +-------------------------------------- +<dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-xpath</artifactId> + <version>x.x.x</version> +</dependency> +-------------------------------------- include::{page-component-version}@camel-spring-boot::page$xpath-starter.adoc[]