Your sample was not pasted nicely and it is not really readable.
But guessing from what you described,  you seem to be saying that the
split result didn't exactly match the schema? In other words, some
namespaces were dropped in the split result? If that is the case, that
can happen when you are using tokenizeXML. To get xml-aware splitting,
you should use xtokenize. see http://camel.apache.org/splitter.html

2015-12-19 14:58 GMT+01:00 sonu123 <sandeepghosh...@rediffmail.com>:
> Hi,
> I have manged to make it work but with a one minor change.  I found my XSD
> has namepace like this
> <xs:schema
> xmlns=&quot;&lt;b>urn:iso:std:iso:20022:tech:xsd:camt.086.001.01*"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"; elementFormDefault="qualified"
> targetNamespace="urn:iso:std:iso:20022:tech:xsd:camt.086.001.01">
> And my xjc generated package-info.java has
> @javax.xml.bind.annotation.XmlSchema(*namespace =
> "urn:iso:std:iso:20022:tech:xsd:camt.086.001.01"*, elementFormDefault =
> javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
> I replaced the namespace with empty string
> @javax.xml.bind.annotation.XmlSchema(namespace = *""*, elementFormDefault =
> javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
>
> Now I can see CurrencyExchange6 class is correctly populated. Let me know if
> there are better ways of doing it.
> My final codes is
> @Override
>     public RouteBuilder createRouteBuilder() {
>         return new RouteBuilder() {
>             @Override
>             public void configure() throws Exception {
>                 final JAXBContext jaxbContext =
> JAXBContext.newInstance(com.main.sandeepone.CurrencyExchange6.class);
>                 JaxbDataFormat jaxb = new JaxbDataFormat(jaxbContext);
>                 CurrencyExchange6 c=new CurrencyExchange6();
>                 jaxb.setPartClass(c.getClass().getCanonicalName());
>                 jaxb.setFragment(true);
>
> from("file:target/in?noop=true&fileName=camt.086.001.01.xml").log("Content
> of the ISO20022  file: ${body}")
>                 .split()
>                 .tokenizeXML("CcyXchg")
>                     .streaming() .executorService(threadPool)
>                     .log("Content of the splitted file: ${body}")
>                    .unmarshal(jaxb)
>                     .log("Content of the marshalled: ${body}")
>                     .to("seda:update")
>                     .end()
>                     .log("Done processing the file:
> ${header.CamelFileName}");
>
>                 from("seda:update?concurrentConsumers=20")
>                     .bean(InventoryService.class, "doSomeThingHere");
>             }
>         };
>     }
>
> sonu123 wrote
>> Tried with stax, but not working.  I am wondering, if there is any way, I
>> can convert the String generated from tokenizeXML into POJO.
>
>
> sonu123 wrote
>> Tried with stax, but not working.  I am wondering, if there is any way, I
>> can convert the String generated from tokenizeXML into POJO.
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Split-and-tokenizeXML-not-working-with-Jaxb-unmarshal-with-Part-class-tp5775239p5775281.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to