camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "phil.xue" <>
Subject Marshall xml with namespace prefix using xmljson
Date Thu, 01 Aug 2013 04:11:48 GMT

Has anyone successfully marshalled XML with namespace prefixed using

A sample XML is shown below in which all elements are prefixed with
namespace "rdm", I'd like to split on Record element to produce 2 json

<rdm:Results xmlns:rdm="">

My route looks like this:

<camelContext id="blueprintContext" trace="false"
	<camel:route id="xmlFeed">
		<camel:from uri="file://source" />
		<camel:split streaming="true">
			<camel:tokenize token="Record" xml="true" />
				<camel:xmljson skipNamespaces="true" removeNamespacePrefixes="true"/>
			<camel:log message="${body}" />

And I'm getting the following error:

Caused by: nu.xom.ParsingException: The prefix "rdm" for element
"rdm:Record" is not bound. at line 1, column 26
	at Source)[258:nu.xom:1.2.5.osgi]
	at Source)[258:nu.xom:1.2.5.osgi]
	... 83 more
Caused by: org.xml.sax.SAXParseException: The prefix "rdm" for element
"rdm:Record" is not bound.
	... 86 more

Seems to me I need to bind the namespace with the marshaller so it's aware
of the namespace but nothing in the doc
( shows that this can be do on xmljson.
btw, xmljson is able to perform the transformation If I add xmlns to each
Record elements, e.g. <rdm:Record xmlns:rdm="">
but unfortunately I have no control over the format of XML file

It's much appreciated if someone could please shed some lights on this



View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message