You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Siano, Stephan" <st...@sap.com> on 2014/12/12 08:39:14 UTC

Is it possible to set the documentType on an XPath in XML DSL (Spring/Blueprint)

Hi,

in Java DSL it is possible to set the documentType on an XPath expression or predicate (that's the type the document is converted to before applying the XPath, not the result type) e.g.:

                from("file://target/file/xpathsplit")
                    // set documentType to org.xml.sax.InputSource then Camel will use SAX to split the file
                    .split(xpath("/persons/person").documentType(InputSource.class)).streaming()
                    .to("mock:splitted");

Is this also possible form XML DSL (Spring/Blueprint)?

If not, wouldn't it be a useful feature in some cases (e.g. when using saxon as the XPath parser)?

Best regards
Stephan



Re: Is it possible to set the documentType on an XPath in XML DSL (Spring/Blueprint)

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I logged a ticket
https://issues.apache.org/jira/browse/CAMEL-8182

On Wed, Dec 17, 2014 at 4:07 PM, Claus Ibsen <cl...@gmail.com> wrote:
> Hi
>
> Yeah sure we can add that option to the xpath definition so its
> available in XML DSL. Feel free to log a JIRA
> http://camel.apache.org/support
>
>
>
> On Fri, Dec 12, 2014 at 8:39 AM, Siano, Stephan <st...@sap.com> wrote:
>> Hi,
>>
>> in Java DSL it is possible to set the documentType on an XPath expression or predicate (that's the type the document is converted to before applying the XPath, not the result type) e.g.:
>>
>>                 from("file://target/file/xpathsplit")
>>                     // set documentType to org.xml.sax.InputSource then Camel will use SAX to split the file
>>                     .split(xpath("/persons/person").documentType(InputSource.class)).streaming()
>>                     .to("mock:splitted");
>>
>> Is this also possible form XML DSL (Spring/Blueprint)?
>>
>> If not, wouldn't it be a useful feature in some cases (e.g. when using saxon as the XPath parser)?
>>
>> Best regards
>> Stephan
>>
>>
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Re: Is it possible to set the documentType on an XPath in XML DSL (Spring/Blueprint)

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Yeah sure we can add that option to the xpath definition so its
available in XML DSL. Feel free to log a JIRA
http://camel.apache.org/support



On Fri, Dec 12, 2014 at 8:39 AM, Siano, Stephan <st...@sap.com> wrote:
> Hi,
>
> in Java DSL it is possible to set the documentType on an XPath expression or predicate (that's the type the document is converted to before applying the XPath, not the result type) e.g.:
>
>                 from("file://target/file/xpathsplit")
>                     // set documentType to org.xml.sax.InputSource then Camel will use SAX to split the file
>                     .split(xpath("/persons/person").documentType(InputSource.class)).streaming()
>                     .to("mock:splitted");
>
> Is this also possible form XML DSL (Spring/Blueprint)?
>
> If not, wouldn't it be a useful feature in some cases (e.g. when using saxon as the XPath parser)?
>
> Best regards
> Stephan
>
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/