You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ode.apache.org by Jagan Mohan Kaveripakam <jk...@yahoo.com> on 2008/08/20 04:00:35 UTC
splitToElement is working for an element
Hi,
Iam trying to parse an String form of XML message into an XML... If I use the follwoning it is thowring an exception as below.. Tried with name sapce also but no use..
ode:splitToElements($input.payload/tns:input,'></tns:ProviderSearchReplyType>',$output.payload/ProviderSearchReplyType'), but when i tried to assign to an XML element it is trowing a Class Cast exception for java.util.ArrayList..
If I use below it works, but it is creating an another element named ''ProviderSearchReplyType' in the output XML message... I dont want to create an extra element, how can I do that.. I have attend the sample POC as attached..
ode:splitToElements($input.payload/tns:input,'></tns:ProviderSearchReplyType>','ProviderSearchReplyType')
Thanks
jagan
Re: splitToElement is working for an element
Posted by Alex Boisvert <bo...@intalio.com>.
Hi Jagan,
The splitToElements function's first parameter is meant to be a String
(containing token-separated values) but instead you are passing a DOM Node
(tns:input). Moreover, using a literal XML element as a token separator
would be a very fragile solution: it would work only in some cases and
would fail for the general case.
I'm actually not clear on your intent here. Could you elaborate?
alex
On Tue, Aug 19, 2008 at 7:00 PM, Jagan Mohan Kaveripakam <
jkaveripakam@yahoo.com> wrote:
> Hi,
>
> Iam trying to parse an String form of XML message into an XML... If I use
> the follwoning it is thowring an exception as below.. Tried with name sapce
> also but no use..
>
> ode:splitToElements($input.payload/tns:input,'></tns:ProviderSearchReplyType>',$output.payload/ProviderSearchReplyType'),
> but when i tried to assign to an XML element it is trowing a Class Cast
> exception for java.util.ArrayList..
>
> If I use below it works, but it is creating an another element named
> ''ProviderSearchReplyType' in the output XML message... I dont want to
> create an extra element, how can I do that.. I have attend the sample POC
> as attached..
>
>
> ode:splitToElements($input.payload/tns:input,'></tns:ProviderSearchReplyType>','ProviderSearchReplyType')
>
> Thanks
> jagan
>
>