You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Andrei Shakirin <as...@talend.com> on 2012/10/18 17:05:44 UTC

Improvement proposal for CXF Transformation Feature

Hi,

Actually CXF Transformation feature covers 99% of user needs:
1) changing input and output element names and namespaces
2) appending new input and output elements
3) replacing text content
4) dropping output and input elements
5) converting attributes to elements

Anyway I see some advanced use cases not supported by CXF Transformation feature, like:
1) replace/rename attributes;
2) replace/remove attributes values
3) replace text on the base of regular expressions
4) process lists
etc.

My proposal is to add property for Transformation feature that specified XSLT transformation script to support such advanced use cases.
It will look like:
<bean id="transformFeature" class="org.apache.cxf.feature.StaxTransformFeature">
  <property name="inXSLT" value="/org/test/my-in.xslt"/>
  <property name="outXSLT" value="/org/test/my-out.xslt"/>
</bean>

XSLT engine Xalan will probably break the streaming (AFAIK is still load tree into memory, incremental transformation just do it in optimized parallel way). But for small messages is still an option and looking forward - probably clean stream oriented XSLT will be supported in the future.

I have basic implementation and will provide a patch, if the improvement makes sense (https://issues.apache.org/jira/browse/CXF-4582 ).

Regards,
Andrei.

Re: Improvement proposal for CXF Transformation Feature

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi Andrei
On 24/10/12 10:24, Andrei Shakirin wrote:
> Hi Sergey,
>
>> Or may be allocate to it "feature.transform" subpackge with the idea of moving the stax feature to it too at the later stage - if you'd like to keep both features
>> in the same package. As I said even "org.apache.cxf.feature" would work :-) but it immediately add one more migration issue if, at some point of time, we
>> decide to find a new home module for the features
>
> Yep, absolutely agree. Will allocate "feature.transform" subpackage in core, your option (2). I think both features (XSLTFeature and StaxTransformFeature) are semantically very close, so it makes sense potentially to keep them in the same package.
> Do you think it also OK to put interceptors in the same package with feature? Actually is designed differently, for example GZIPFeature located in the same package with interceptors, Logging and StaxTransform - in different. If yes, probably makes sense to name the package just "transform" instead "feature.transform"?
>
I don't mind - either works for me :-) - unless someone else has 
something to add. I guess what you've effectively pointed out is that at 
some stage it will make sense to regroup few things (to do with the 
features and their interceptors)

Thanks, Sergey

> Regards,
> Andrei.
>
> -----Original Message-----
> From: Sergey Beryozkin [mailto:sberyozkin@gmail.com]
> Sent: Mittwoch, 24. Oktober 2012 11:05
> To: Andrei Shakirin
> Cc: users@cxf.apache.org
> Subject: Re: Improvement proposal for CXF Transformation Feature
>
> Hi
> On 23/10/12 13:19, Sergey Beryozkin wrote:
>> Hi Andrei
>> On 23/10/12 13:06, Andrei Shakirin wrote:
>>> Hi Sergei,
>>>
>>> I see that StaxTransformerFeature and interceptors in
>>> org.apache.interceptor.transform package were promoted to API component.
>>> As I understand it was done to avoid exporting the same packages from
>>> different CXF modules.
>>> Question: is API component also the right place for XSLTFeature and
>>> it's interceptors? I think it makes sense to keep
>>> StaxTransformerFeature and XSLTFeature in the same package.
>>
>> I guess they should both live in rt/core but as you mentioned api
>> module is the home for the STAX transformer feature for now, though
>> perhaps we should have had it moved to "feature.transform" subpackage
>> in rt/core to avoid OSGI-level issues (guess this can be done in CXF 2.8.0 for example).
>>
>> IMHO it may make sense to consider allocating
>> "org.apache.cxf.feature.xslt" to XSLTFeature, and consider placing it
>> in rt/core or in api with the idea of moving transform and xslt
>> features out later on. If we do allocate "org.apache.cxf.feature" for
>> it then I guess it will be difficult to move it out of API at the
>> later stage
>>
> Or may be allocate to it "feature.transform" subpackge with the idea of moving the stax feature to it too at the later stage - if you'd like to keep both features in the same package. As I said even "org.apache.cxf.feature" would work :-) but it immediately add one more migration issue if, at some point of time, we decide to find a new home module for the features
>
> Cheers, Sergey
>
>>
>>
>>>
>>> Regards,
>>> Andrei.
>>>
>>> -----Original Message-----
>>> From: Sergey Beryozkin [mailto:sberyozkin@gmail.com]
>>> Sent: Donnerstag, 18. Oktober 2012 17:21
>>> To: users@cxf.apache.org
>>> Cc: Andrei Shakirin
>>> Subject: Re: Improvement proposal for CXF Transformation Feature
>>>
>>> Hi Andrei
>>> On 18/10/12 16:05, Andrei Shakirin wrote:
>>>> Hi,
>>>>
>>>> Actually CXF Transformation feature covers 99% of user needs:
>>>> 1) changing input and output element names and namespaces
>>>> 2) appending new input and output elements
>>>> 3) replacing text content
>>>> 4) dropping output and input elements
>>>> 5) converting attributes to elements
>>>>
>>>> Anyway I see some advanced use cases not supported by CXF
>>>> Transformation feature, like:
>>>> 1) replace/rename attributes;
>>>> 2) replace/remove attributes values
>>>> 3) replace text on the base of regular expressions
>>>> 4) process lists
>>>> etc.
>>>>
>>>> My proposal is to add property for Transformation feature that
>>>> specified XSLT transformation script to support such advanced use cases.
>>>> It will look like:
>>>> <bean id="transformFeature"
>>>> class="org.apache.cxf.feature.StaxTransformFeature">
>>>> <property name="inXSLT" value="/org/test/my-in.xslt"/>  <property
>>>> name="outXSLT" value="/org/test/my-out.xslt"/>  </bean>
>>>>
>>>> XSLT engine Xalan will probably break the streaming (AFAIK is still
>>>> load tree into memory, incremental transformation just do it in
>>>> optimized parallel way). But for small messages is still an option
>>>> and looking forward - probably clean stream oriented XSLT will be
>>>> supported in the future.
>>>>
>>>> I have basic implementation and will provide a patch, if the
>>>> improvement makes sense
>>>> (https://issues.apache.org/jira/browse/CXF-4582 ).
>>>>
>>> I think it would sense to come up with a standalone XSLTFeature which
>>> would be much simpler, implementation wise, compared to
>>> StaxTransformFeature, which is really a light-weight alternative to
>>> XSLT itself.
>>>
>>> Cheers, Sergey
>>>
>>>> Regards,
>>>> Andrei.
>>>>
>>>
>>>
>>> --
>>> Sergey Beryozkin
>>>
>>> Talend Community Coders
>>> http://coders.talend.com/
>>>
>>> Blog: http://sberyozkin.blogspot.com
>>
>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>
> Blog: http://sberyozkin.blogspot.com


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

RE: Improvement proposal for CXF Transformation Feature

Posted by Andrei Shakirin <as...@talend.com>.
Hi Sergey,

>Or may be allocate to it "feature.transform" subpackge with the idea of moving the stax feature to it too at the later stage - if you'd like to keep both features 
>in the same package. As I said even "org.apache.cxf.feature" would work :-) but it immediately add one more migration issue if, at some point of time, we 
>decide to find a new home module for the features

Yep, absolutely agree. Will allocate "feature.transform" subpackage in core, your option (2). I think both features (XSLTFeature and StaxTransformFeature) are semantically very close, so it makes sense potentially to keep them in the same package.
Do you think it also OK to put interceptors in the same package with feature? Actually is designed differently, for example GZIPFeature located in the same package with interceptors, Logging and StaxTransform - in different. If yes, probably makes sense to name the package just "transform" instead "feature.transform"?

Regards,
Andrei.

-----Original Message-----
From: Sergey Beryozkin [mailto:sberyozkin@gmail.com] 
Sent: Mittwoch, 24. Oktober 2012 11:05
To: Andrei Shakirin
Cc: users@cxf.apache.org
Subject: Re: Improvement proposal for CXF Transformation Feature

Hi
On 23/10/12 13:19, Sergey Beryozkin wrote:
> Hi Andrei
> On 23/10/12 13:06, Andrei Shakirin wrote:
>> Hi Sergei,
>>
>> I see that StaxTransformerFeature and interceptors in 
>> org.apache.interceptor.transform package were promoted to API component.
>> As I understand it was done to avoid exporting the same packages from 
>> different CXF modules.
>> Question: is API component also the right place for XSLTFeature and 
>> it's interceptors? I think it makes sense to keep 
>> StaxTransformerFeature and XSLTFeature in the same package.
>
> I guess they should both live in rt/core but as you mentioned api 
> module is the home for the STAX transformer feature for now, though 
> perhaps we should have had it moved to "feature.transform" subpackage 
> in rt/core to avoid OSGI-level issues (guess this can be done in CXF 2.8.0 for example).
>
> IMHO it may make sense to consider allocating 
> "org.apache.cxf.feature.xslt" to XSLTFeature, and consider placing it 
> in rt/core or in api with the idea of moving transform and xslt 
> features out later on. If we do allocate "org.apache.cxf.feature" for 
> it then I guess it will be difficult to move it out of API at the 
> later stage
>
Or may be allocate to it "feature.transform" subpackge with the idea of moving the stax feature to it too at the later stage - if you'd like to keep both features in the same package. As I said even "org.apache.cxf.feature" would work :-) but it immediately add one more migration issue if, at some point of time, we decide to find a new home module for the features

Cheers, Sergey

>
>
>>
>> Regards,
>> Andrei.
>>
>> -----Original Message-----
>> From: Sergey Beryozkin [mailto:sberyozkin@gmail.com]
>> Sent: Donnerstag, 18. Oktober 2012 17:21
>> To: users@cxf.apache.org
>> Cc: Andrei Shakirin
>> Subject: Re: Improvement proposal for CXF Transformation Feature
>>
>> Hi Andrei
>> On 18/10/12 16:05, Andrei Shakirin wrote:
>>> Hi,
>>>
>>> Actually CXF Transformation feature covers 99% of user needs:
>>> 1) changing input and output element names and namespaces
>>> 2) appending new input and output elements
>>> 3) replacing text content
>>> 4) dropping output and input elements
>>> 5) converting attributes to elements
>>>
>>> Anyway I see some advanced use cases not supported by CXF 
>>> Transformation feature, like:
>>> 1) replace/rename attributes;
>>> 2) replace/remove attributes values
>>> 3) replace text on the base of regular expressions
>>> 4) process lists
>>> etc.
>>>
>>> My proposal is to add property for Transformation feature that 
>>> specified XSLT transformation script to support such advanced use cases.
>>> It will look like:
>>> <bean id="transformFeature"
>>> class="org.apache.cxf.feature.StaxTransformFeature">
>>> <property name="inXSLT" value="/org/test/my-in.xslt"/> <property 
>>> name="outXSLT" value="/org/test/my-out.xslt"/> </bean>
>>>
>>> XSLT engine Xalan will probably break the streaming (AFAIK is still 
>>> load tree into memory, incremental transformation just do it in 
>>> optimized parallel way). But for small messages is still an option 
>>> and looking forward - probably clean stream oriented XSLT will be 
>>> supported in the future.
>>>
>>> I have basic implementation and will provide a patch, if the 
>>> improvement makes sense
>>> (https://issues.apache.org/jira/browse/CXF-4582 ).
>>>
>> I think it would sense to come up with a standalone XSLTFeature which 
>> would be much simpler, implementation wise, compared to 
>> StaxTransformFeature, which is really a light-weight alternative to 
>> XSLT itself.
>>
>> Cheers, Sergey
>>
>>> Regards,
>>> Andrei.
>>>
>>
>>
>> --
>> Sergey Beryozkin
>>
>> Talend Community Coders
>> http://coders.talend.com/
>>
>> Blog: http://sberyozkin.blogspot.com
>


--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Re: Improvement proposal for CXF Transformation Feature

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 23/10/12 13:19, Sergey Beryozkin wrote:
> Hi Andrei
> On 23/10/12 13:06, Andrei Shakirin wrote:
>> Hi Sergei,
>>
>> I see that StaxTransformerFeature and interceptors in
>> org.apache.interceptor.transform package were promoted to API component.
>> As I understand it was done to avoid exporting the same packages from
>> different CXF modules.
>> Question: is API component also the right place for XSLTFeature and
>> it's interceptors? I think it makes sense to keep
>> StaxTransformerFeature and XSLTFeature in the same package.
>
> I guess they should both live in rt/core but as you mentioned api module
> is the home for the STAX transformer feature for now, though perhaps we
> should have had it moved to "feature.transform" subpackage in rt/core to
> avoid OSGI-level issues (guess this can be done in CXF 2.8.0 for example).
>
> IMHO it may make sense to consider allocating
> "org.apache.cxf.feature.xslt" to XSLTFeature, and consider placing it in
> rt/core or in api with the idea of moving transform and xslt features
> out later on. If we do allocate "org.apache.cxf.feature" for it then I
> guess it will be difficult to move it out of API at the later stage
>
Or may be allocate to it "feature.transform" subpackge with the idea of 
moving the stax feature to it too at the later stage - if you'd like to 
keep both features in the same package. As I said even 
"org.apache.cxf.feature" would work :-) but it immediately add one more 
migration issue if, at some point of time, we decide to find a new home 
module for the features

Cheers, Sergey

>
>
>>
>> Regards,
>> Andrei.
>>
>> -----Original Message-----
>> From: Sergey Beryozkin [mailto:sberyozkin@gmail.com]
>> Sent: Donnerstag, 18. Oktober 2012 17:21
>> To: users@cxf.apache.org
>> Cc: Andrei Shakirin
>> Subject: Re: Improvement proposal for CXF Transformation Feature
>>
>> Hi Andrei
>> On 18/10/12 16:05, Andrei Shakirin wrote:
>>> Hi,
>>>
>>> Actually CXF Transformation feature covers 99% of user needs:
>>> 1) changing input and output element names and namespaces
>>> 2) appending new input and output elements
>>> 3) replacing text content
>>> 4) dropping output and input elements
>>> 5) converting attributes to elements
>>>
>>> Anyway I see some advanced use cases not supported by CXF
>>> Transformation feature, like:
>>> 1) replace/rename attributes;
>>> 2) replace/remove attributes values
>>> 3) replace text on the base of regular expressions
>>> 4) process lists
>>> etc.
>>>
>>> My proposal is to add property for Transformation feature that
>>> specified XSLT transformation script to support such advanced use cases.
>>> It will look like:
>>> <bean id="transformFeature"
>>> class="org.apache.cxf.feature.StaxTransformFeature">
>>> <property name="inXSLT" value="/org/test/my-in.xslt"/>
>>> <property name="outXSLT" value="/org/test/my-out.xslt"/> </bean>
>>>
>>> XSLT engine Xalan will probably break the streaming (AFAIK is still
>>> load tree into memory, incremental transformation just do it in
>>> optimized parallel way). But for small messages is still an option
>>> and looking forward - probably clean stream oriented XSLT will be
>>> supported in the future.
>>>
>>> I have basic implementation and will provide a patch, if the
>>> improvement makes sense
>>> (https://issues.apache.org/jira/browse/CXF-4582 ).
>>>
>> I think it would sense to come up with a standalone XSLTFeature which
>> would be much simpler, implementation wise, compared to
>> StaxTransformFeature, which is really a light-weight alternative to
>> XSLT itself.
>>
>> Cheers, Sergey
>>
>>> Regards,
>>> Andrei.
>>>
>>
>>
>> --
>> Sergey Beryozkin
>>
>> Talend Community Coders
>> http://coders.talend.com/
>>
>> Blog: http://sberyozkin.blogspot.com
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Re: Improvement proposal for CXF Transformation Feature

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi Andrei
On 23/10/12 13:06, Andrei Shakirin wrote:
> Hi Sergei,
>
> I see that StaxTransformerFeature and interceptors in org.apache.interceptor.transform package were promoted to API component.
> As I understand it was done to avoid exporting the same packages from different CXF modules.
> Question: is API component also the right place for XSLTFeature and it's interceptors? I think it makes sense to keep StaxTransformerFeature and XSLTFeature in the same package.

I guess they should both live in rt/core but as you mentioned api module 
is the home for the STAX transformer feature for now, though perhaps we 
should have had it moved to "feature.transform" subpackage in rt/core to 
avoid OSGI-level issues (guess this can be done in CXF 2.8.0 for example).

IMHO it may make sense to consider allocating 
"org.apache.cxf.feature.xslt" to XSLTFeature, and consider placing it in 
rt/core or in api with the idea of moving transform and xslt features 
out later on. If we do allocate "org.apache.cxf.feature" for it then I 
guess it will be difficult to move it out of API at the later stage

Cheers, Sergey


>
> Regards,
> Andrei.
>
> -----Original Message-----
> From: Sergey Beryozkin [mailto:sberyozkin@gmail.com]
> Sent: Donnerstag, 18. Oktober 2012 17:21
> To: users@cxf.apache.org
> Cc: Andrei Shakirin
> Subject: Re: Improvement proposal for CXF Transformation Feature
>
> Hi Andrei
> On 18/10/12 16:05, Andrei Shakirin wrote:
>> Hi,
>>
>> Actually CXF Transformation feature covers 99% of user needs:
>> 1) changing input and output element names and namespaces
>> 2) appending new input and output elements
>> 3) replacing text content
>> 4) dropping output and input elements
>> 5) converting attributes to elements
>>
>> Anyway I see some advanced use cases not supported by CXF Transformation feature, like:
>> 1) replace/rename attributes;
>> 2) replace/remove attributes values
>> 3) replace text on the base of regular expressions
>> 4) process lists
>> etc.
>>
>> My proposal is to add property for Transformation feature that specified XSLT transformation script to support such advanced use cases.
>> It will look like:
>> <bean id="transformFeature" class="org.apache.cxf.feature.StaxTransformFeature">
>>     <property name="inXSLT" value="/org/test/my-in.xslt"/>
>>     <property name="outXSLT" value="/org/test/my-out.xslt"/>  </bean>
>>
>> XSLT engine Xalan will probably break the streaming (AFAIK is still load tree into memory, incremental transformation just do it in optimized parallel way). But for small messages is still an option and looking forward - probably clean stream oriented XSLT will be supported in the future.
>>
>> I have basic implementation and will provide a patch, if the improvement makes sense (https://issues.apache.org/jira/browse/CXF-4582 ).
>>
> I think it would sense to come up with a standalone XSLTFeature which would be much simpler, implementation wise, compared to StaxTransformFeature, which is really a light-weight alternative to XSLT itself.
>
> Cheers, Sergey
>
>> Regards,
>> Andrei.
>>
>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>
> Blog: http://sberyozkin.blogspot.com


RE: Improvement proposal for CXF Transformation Feature

Posted by Andrei Shakirin <as...@talend.com>.
Hi Sergei,

I see that StaxTransformerFeature and interceptors in org.apache.interceptor.transform package were promoted to API component.
As I understand it was done to avoid exporting the same packages from different CXF modules.
Question: is API component also the right place for XSLTFeature and it's interceptors? I think it makes sense to keep StaxTransformerFeature and XSLTFeature in the same package.

Regards,
Andrei.

-----Original Message-----
From: Sergey Beryozkin [mailto:sberyozkin@gmail.com] 
Sent: Donnerstag, 18. Oktober 2012 17:21
To: users@cxf.apache.org
Cc: Andrei Shakirin
Subject: Re: Improvement proposal for CXF Transformation Feature

Hi Andrei
On 18/10/12 16:05, Andrei Shakirin wrote:
> Hi,
>
> Actually CXF Transformation feature covers 99% of user needs:
> 1) changing input and output element names and namespaces
> 2) appending new input and output elements
> 3) replacing text content
> 4) dropping output and input elements
> 5) converting attributes to elements
>
> Anyway I see some advanced use cases not supported by CXF Transformation feature, like:
> 1) replace/rename attributes;
> 2) replace/remove attributes values
> 3) replace text on the base of regular expressions
> 4) process lists
> etc.
>
> My proposal is to add property for Transformation feature that specified XSLT transformation script to support such advanced use cases.
> It will look like:
> <bean id="transformFeature" class="org.apache.cxf.feature.StaxTransformFeature">
>    <property name="inXSLT" value="/org/test/my-in.xslt"/>
>    <property name="outXSLT" value="/org/test/my-out.xslt"/> </bean>
>
> XSLT engine Xalan will probably break the streaming (AFAIK is still load tree into memory, incremental transformation just do it in optimized parallel way). But for small messages is still an option and looking forward - probably clean stream oriented XSLT will be supported in the future.
>
> I have basic implementation and will provide a patch, if the improvement makes sense (https://issues.apache.org/jira/browse/CXF-4582 ).
>
I think it would sense to come up with a standalone XSLTFeature which would be much simpler, implementation wise, compared to StaxTransformFeature, which is really a light-weight alternative to XSLT itself.

Cheers, Sergey

> Regards,
> Andrei.
>


--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Re: Improvement proposal for CXF Transformation Feature

Posted by Gary Gregory <ga...@gmail.com>.
On Thu, Oct 18, 2012 at 11:21 AM, Sergey Beryozkin <sb...@gmail.com>wrote:

> Hi Andrei
> On 18/10/12 16:05, Andrei Shakirin wrote:
>
>> Hi,
>>
>> Actually CXF Transformation feature covers 99% of user needs:
>> 1) changing input and output element names and namespaces
>> 2) appending new input and output elements
>> 3) replacing text content
>> 4) dropping output and input elements
>> 5) converting attributes to elements
>>
>> Anyway I see some advanced use cases not supported by CXF Transformation
>> feature, like:
>> 1) replace/rename attributes;
>> 2) replace/remove attributes values
>> 3) replace text on the base of regular expressions
>> 4) process lists
>> etc.
>>
>> My proposal is to add property for Transformation feature that specified
>> XSLT transformation script to support such advanced use cases.
>> It will look like:
>> <bean id="transformFeature" class="org.apache.cxf.feature.**
>> StaxTransformFeature">
>>    <property name="inXSLT" value="/org/test/my-in.xslt"/>
>>    <property name="outXSLT" value="/org/test/my-out.xslt"/**>
>> </bean>
>>
>> XSLT engine Xalan will probably break the streaming (AFAIK is still load
>> tree into memory, incremental transformation just do it in optimized
>> parallel way). But for small messages is still an option and looking
>> forward - probably clean stream oriented XSLT will be supported in the
>> future.
>>
>> I have basic implementation and will provide a patch, if the improvement
>> makes sense (https://issues.apache.org/**jira/browse/CXF-4582<https://issues.apache.org/jira/browse/CXF-4582>).
>>
>>  I think it would sense to come up with a standalone XSLTFeature which
> would be much simpler, implementation wise, compared to
> StaxTransformFeature, which is really a light-weight alternative to XSLT
> itself.
>

Yes, please!

I would like to be able express this, which I currently do with funky hard
to maintain interceptors:

validate input vs. XSD 1
apply XSLT 1
validate transformed input vs. XSD 2

validate output vs. XSD 3
apply XSLT 2
validate transformed output vs. XSD 4

Gary

> Cheers, Sergey
>
>  Regards,
>> Andrei.
>>
>>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>
> Blog: http://sberyozkin.blogspot.com
>



-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: Improvement proposal for CXF Transformation Feature

Posted by Daniel Kulp <dk...@apache.org>.
On Oct 18, 2012, at 11:21 AM, Sergey Beryozkin <sb...@gmail.com> wrote:

> Hi Andrei
> On 18/10/12 16:05, Andrei Shakirin wrote:
>> 
>> XSLT engine Xalan will probably break the streaming (AFAIK is still load tree into memory, incremental transformation just do it in optimized parallel way). But for small messages is still an option and looking forward - probably clean stream oriented XSLT will be supported in the future.
>> 
>> I have basic implementation and will provide a patch, if the improvement makes sense (https://issues.apache.org/jira/browse/CXF-4582 ).
>> 
> I think it would sense to come up with a standalone XSLTFeature which would be much simpler, implementation wise, compared to StaxTransformFeature, which is really a light-weight alternative to XSLT itself.

I agree with this.   

Dan



> 
> Cheers, Sergey
> 
>> Regards,
>> Andrei.
>> 
> 
> 
> -- 
> Sergey Beryozkin
> 
> Talend Community Coders
> http://coders.talend.com/
> 
> Blog: http://sberyozkin.blogspot.com

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: Improvement proposal for CXF Transformation Feature

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi Andrei
On 18/10/12 16:05, Andrei Shakirin wrote:
> Hi,
>
> Actually CXF Transformation feature covers 99% of user needs:
> 1) changing input and output element names and namespaces
> 2) appending new input and output elements
> 3) replacing text content
> 4) dropping output and input elements
> 5) converting attributes to elements
>
> Anyway I see some advanced use cases not supported by CXF Transformation feature, like:
> 1) replace/rename attributes;
> 2) replace/remove attributes values
> 3) replace text on the base of regular expressions
> 4) process lists
> etc.
>
> My proposal is to add property for Transformation feature that specified XSLT transformation script to support such advanced use cases.
> It will look like:
> <bean id="transformFeature" class="org.apache.cxf.feature.StaxTransformFeature">
>    <property name="inXSLT" value="/org/test/my-in.xslt"/>
>    <property name="outXSLT" value="/org/test/my-out.xslt"/>
> </bean>
>
> XSLT engine Xalan will probably break the streaming (AFAIK is still load tree into memory, incremental transformation just do it in optimized parallel way). But for small messages is still an option and looking forward - probably clean stream oriented XSLT will be supported in the future.
>
> I have basic implementation and will provide a patch, if the improvement makes sense (https://issues.apache.org/jira/browse/CXF-4582 ).
>
I think it would sense to come up with a standalone XSLTFeature which 
would be much simpler, implementation wise, compared to 
StaxTransformFeature, which is really a light-weight alternative to XSLT 
itself.

Cheers, Sergey

> Regards,
> Andrei.
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com