Hi Oh can you try using expression instead of path, so its
expression: xtokenize: id: xtokenize-460a expression: //Batchmaster mode: w On Wed, Mar 1, 2023 at 10:13 PM Claus Ibsen <claus.ib...@gmail.com> wrote: > Hi > > Ah there is a point that xtokenize is using @XmlValue to set that "path". > And the yaml-dsl is potentially not handing this correctly. > Can you create a JIRA ticket and I will try to find some time to look > at it? > > On Wed, Mar 1, 2023 at 7:35 PM Chirag <chirag.sangh...@gmail.com> wrote: > >> I am using 3.20.0 >> >> >> Here is my route in XML DSL: >> <?xml version="1.0" encoding="UTF-8"?> >> <!-- camel-k: language=xml --> >> >> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >> xmlns="http://camel.apache.org/schema/spring" >> xsi:schemaLocation=" >> http://camel.apache.org/schema/spring >> https://camel.apache.org/schema/spring/camel-spring.xsd"> >> >> <!-- Write your routes here, for example: --> >> >> <route> >> <from uri="file:///c://work//batchsplit//in"/> >> <split streaming="true"> >> <xtokenize mode="w">//BatchMaster</xtokenize> >> <to uri="file:///c://work//batchsplit//out?fileName=${exchangeId}.xml"/> >> </split> >> </route> >> >> </routes> >> >> >> Trying to redefine this to be Yaml so that this could be >> edited/maintained thru Karavan. >> >> ચિરાગ/चिराग/Chirag >> ------------------------------------------ >> Sent from My Gmail Account >> On Wed, Mar 1, 2023 at 1:14 AM Claus Ibsen <claus.ib...@gmail.com> wrote: >> > >> > Hi >> > >> > What karavan version do you use? >> > >> > xtokenize only have >> > - mode >> > - group >> > >> > as options so it may seem you use an outdated karavan version, or >> something? >> > >> > You can try karavan online via >> > https://karavan.space/ >> > >> > And I copied your code and there is no "path" in the UI. Remove that. >> > >> > >> > >> > On Tue, Feb 28, 2023 at 7:40 PM Chirag <chirag.sangh...@gmail.com> >> wrote: >> > >> > > This is actually two questions in one: >> > > >> > > I am trying to build YAML to perform an XML Splitter (I was able to >> > > build one using XML DSL). >> > > >> > > Now trying with YAML DSL. >> > > >> > > Here is YAML that I came up with using Karavan that looks / feels >> > > similar to XML DSL. >> > > - route: >> > > id: route-a6b4 >> > > from: >> > > uri: file:/work/batchsplit/in >> > > id: from-d1ca >> > > steps: >> > > - split: >> > > id: split-6d45 >> > > expression: >> > > xtokenize: >> > > id: xtokenize-460a >> > > path: //Batchmaster >> > > mode: w >> > > streaming: true >> > > steps: >> > > - to: >> > > uri: >> file:/work/batchsplit/out?fileName=${exchangeId}.xml >> > > id: to-1a10 >> > > >> > > It is erroring out: >> > > >> > > C:\work\batchsplit>camel run batchsplitversion1.camel.yaml >> > > 2023-02-28 13:25:15.565 INFO 5972 --- [ main] >> > > org.apache.camel.main.MainSupport : Apache Camel (JBang) 3.20.2 is >> > > starting >> > > 2023-02-28 13:25:15.860 INFO 5972 --- [ main] >> > > org.apache.camel.main.MainSupport : Using Java 19.0.1 with PID 5972. >> > > Started by csanghavi in C:\work\batchsplit >> > > 2023-02-28 13:25:15.873 INFO 5972 --- [ main] >> > > mel.cli.connector.LocalCliConnector : Camel CLI enabled (local) >> > > Unsupported field: path >> > > in file:batchsplitversion1.camel.yaml, line 12, column 23: >> > > path: "//Batchmaster" >> > > ^ >> > > >> > > at >> > > >> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.handleUnknownProperty(YamlDeserializerBase.java:132) >> > > at >> > > >> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.setProperties(YamlDeserializerBase.java:126) >> > > at >> > > >> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.construct(YamlDeserializerBase.java:65) >> > > >> > > a) what would be the right way to provide xpath for splitting to >> xtokenize. >> > > b) how to provide that using Karavan (Screenshot attached). >> > > >> > > Info: >> > > Karavan running within Visual Studio Code on Windows. Route running >> > > under Jbang 3.20.2 on Windows. >> > > >> > > Regards, >> > > >> > > ચિરાગ/चिराग/Chirag >> > > ------------------------------------------ >> > > Sent from My Gmail Account >> > > >> > >> > >> > -- >> > Claus Ibsen >> > ----------------- >> > @davsclaus >> > Camel in Action 2: https://www.manning.com/ibsen2 >> > > > -- > Claus Ibsen > ----------------- > @davsclaus > Camel in Action 2: https://www.manning.com/ibsen2 > -- Claus Ibsen ----------------- @davsclaus Camel in Action 2: https://www.manning.com/ibsen2