I think you should not have any problems, the conversion is really simple. After split statement you have a Node as body. For XSLT you need a Source. Try adding this instead setBody
<camel:convertBodyTo javaType="org.w3c.dom.Document" /> That should force conversion to document object and I belive fix your problem. Best regards, Łukasz Dywicki -- Code-House http://code-house.org Wiadomość napisana przez Chris Geer w dniu 2012-01-26, o godz. 01:36: > Doug, > > It doesn't make much sense to me either but I do know that with the setBody > command everything works and without it, it fails. If I run the XSLT > against the same XML (save the XML to a file from the flow after the split) > in netbeans it works fine without the <?xml...?> but in camel it fails. > > Could the split be converting the output to a string? That would explain > the problem. > > Chris > > On Wed, Jan 25, 2012 at 5:03 PM, Doug Douglass <douglass.d...@gmail.com>wrote: > >> Chris, >> >> I think the xml processing "fix" you've got there is a bit of red-herring. >> >> The xml processing instruction should only be necessary if you are >> converting the output of the xpath to a String prior to the xslt endpoint, >> whether directly or indirectly. Without any explicit conversion, the output >> of the xpath will be a Node object (DeferredElementNSImpl in my test), >> which is converted to a Source via camel's built-in type conversion. >> >> I just set up a quick unit test with a route very similar to yours and >> everything worked as I expected. Granted this test was in an existing >> project using camel 2.7.3 (time to upgrade!). >> >> I suspect you're either running into a namespace problem[1] or your >> templates XPaths aren't expecting Parcel (from your example) as the root >> element. >> >> [1] >> http://camel.apache.org/xpath.html#XPath-Namespaceauditingtoaiddebugging >> >> Let us know more info (example XML and XSLT) if my suspicions are off base. >> >> HTH, >> Doug >> >> On Wed, Jan 25, 2012 at 3:35 PM, Chris Geer <ch...@cxtsoftware.com> wrote: >> >>> Sorry, 2.8.3. >>> >>> On Wed, Jan 25, 2012 at 3:29 PM, Babak Vahdat >>> <babak.vah...@swissonline.ch>wrote: >>> >>>> And what about the Camel version you use? >>>> >>>> Babak >>>> >>>> -- >>>> View this message in context: >>>> >>> >> http://camel.465427.n5.nabble.com/Splitting-on-XML-Documents-tp5431032p5431531.html >>>> Sent from the Camel - Users mailing list archive at Nabble.com. >>>> >>> >>