cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 9916] New: - javax.xml.transform.Transformer accepts object parameters and cocoon prevents to use it
Date Mon, 17 Jun 2002 12:14:12 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9916>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9916

javax.xml.transform.Transformer accepts object parameters and cocoon prevents to use it

           Summary: javax.xml.transform.Transformer accepts object
                    parameters and cocoon prevents to use it
           Product: Cocoon 2
           Version: Current CVS
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: core
        AssignedTo: cocoon-dev@xml.apache.org
        ReportedBy: maurice.schoenmakers@they-do-it.com


The current TraxTransformer allows only strings to be passed as parameters to 
the transfomer, where as the javax.xml.transform.Transformer interface allows 
also objects. For a good reason (from the API doc): "value - The value object. 
This can be any valid Java object. It is up to the processor to provide the 
proper object coersion or to simply pass the object on for use in an 
extension."

XALAN extensions for example can handle these object parameters.
(for example an extension could be used to collect data during the XSL 
processing, that is again used for the sitemap to select the next action..)

This limitation is caused by the Avalon Parameters class and the way the 
MapStack is resolved.

Here some (maybe stupid) ideas for enhancements to overcome this limitations. 
For example
1) extend the TraxTransformer with a parameter "object-model-parameters-key" 
that causes the transformer to use additionally the parameters in a map that 
is extracted from the object model using the provided key:
Map parameters = objectModel.get( <value of the parameter object-model-
parameters-key> )

or 2) change the avalon Parameters class

or 3) (3a) change the 
org.apache.cocoon.components.treeprocessor.MapStackResolver class to return a 
Map instead of Parameters and only call toString if the expression contains 
more than one parameter or additional text besides parameters. ( "{x}" sets 
the reference, "a{x}{y}" would call toString() for x and y. )
and (3b) add a method to the interfaces of action, transformes etc. to use a 
map as parameters argument. (an abstract implementation could still transform 
the map to Parameters and call the old method ?)

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message