cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrei Shakirin <ashaki...@talend.com>
Subject RE: CXF transformation feature to change namespace to element and all its children.
Date Wed, 07 Oct 2015 14:16:33 GMT
Hi,

Btw you can evaluate XSLT Feature http://cxf.apache.org/docs/xslt-feature.html .
It was designed for advanced use cases, where simple transformation is not enough.
XSLT Feature applies custom XSL transformations to inbound and/or outbound messages.

Regards,
Andrei.

> -----Original Message-----
> From: Iacopo ROZZO [mailto:iacopo.rozzo@amadeus.com]
> Sent: Dienstag, 6. Oktober 2015 18:12
> To: users@cxf.apache.org
> Subject: RE: CXF transformation feature to change namespace to element and
> all its children.
> 
> Thx for the prompt reply, but I think I oversimplified the example, my fault. In
> the actual scenario I want to handle there are several elements belonging to
> the default namespace, and I want to change namespace only to one particular
> element (including its children elements):
> 
> Input:
> <sales xmlns:"http://ns.a">
> <dvd>
>   <title>CXF ...</title>
>   <price>38.68</price>
> </dvd>
> <cd>
>   <title>CXF ...</title>
>   <price>38.68</price>
> </cd>
> ...
> <book>
>   <title>CXF ...</title>
>   <price>38.68</price>
> </book>
> </sales>
> 
> Expected:
> <sales xmlns:"http://ns.a">
> <dvd>
>   <title>CXF ...</title>
>   <price>38.68</price>
> </dvd>
> <cd>
>   <title>CXF ...</title>
>   <price>38.68</price>
> </cd>
> ...
> <book xmlns:"http://ns.b">
>   <title>CXF ...</title>
>   <price>38.68</price>
> </book>
> </sales>
> 
> I looked to the code and I think that it is not possible to achieve that without
> specifying all children elements explicitly in the map. Am I correct?
> 
> Iacopo
> 
> 
> -----Original Message-----
> From: Sergey Beryozkin [mailto:sberyozkin@gmail.com]
> Sent: 06 October 2015 16:42
> To: users@cxf.apache.org
> Subject: Re: CXF transformation feature to change namespace to element and
> all its children.
> 
> Hi
> 
> Can you try setting these two entries:
> 
> "{http://ns.a}sales => {http://ns.a}sales"
> "{http://ns.a}* => {http://ns.b}*"
> 
> Cheers, Sergey
> On 06/10/15 15:11, Iacopo ROZZO wrote:
> > Hi all,
> >
> > I'm using cxf 3.0.2 and I have a question regarding the CXF transformation
> feature<http://cxf.apache.org/docs/transformationfeature.html>. I have the
> following scenario:
> >
> > Input: All elements belong to namespace "ns.a"
> >
> > <sales xmlns:"http://ns.a">
> > <book>
> >    <title>CXF ...</title>
> >    <price>38.68</price>
> > </book>
> > </sales>
> >
> > Expected output: Elements book, title and price should belong to namespace
> "ns.b"
> > <sales xmlns:"http://ns.a">
> > <book xmlns:"http://ns.b">
> >    <title>CXF ...</title>
> >    <price>38.68</price>
> > </book>
> > </sales>
> >
> > If I only add this entry "{http://ns.a}book => {http://ns.b}book" to the
> transformation map the namespace is only changed to book element (as
> normal). Is there any way of qualifying book and all its child elements without
> putting explicitly an entry for all book children elements?
> >
> > Thanks,
> > Iacopo
> >
> >
> 
> 
> --
> Sergey Beryozkin
> 
> Talend Community Coders
> http://coders.talend.com/

Mime
View raw message