xml-xalan-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robbie.ceulem...@kbc.be
Subject RE: set stylesheet parameters when using transformation chaining!
Date Thu, 03 Oct 2002 08:51:30 GMT
To be able to use parameters in a transformation chain, I did a small hack
in Xalan:

- add a getter method in the TrAXFilter class for the m_transformer field.
- after creating an XMLFilter from the SAXTransformerFactory, do the
following:
Transformer transformer = ((TrAXFilter)filter).getTransformer();
transformer.setParameter("testParam", "value");

This works fine, but of course it's not nice. Anybody has an idea if
there's a solution without needing to hack into Xalan?


Thanks,
Robbie

----- Forwarded by ROBBIE CEULEMANS/U81141/KBC_BANK on 03/10/02 10:42 -----
                                                                                         
                         
                    robbie.ceulema                                                       
                         
                    ns@kbc.be            To:     xalan-j-users@xml.apache.org            
                         
                                         cc:                                             
                         
                    02/10/02 16:07       Subject:     set stylesheet parameters when using
transformation          
                                          chaining!                                      
                         
                                                                                         
                         




I am using the SAX Transformation chaining capabilities of Xalan. However,
setting a parameter to the transformer doesn't seem to work.

code:
SAXTransformerFactory stf = (SAXTransformerFactory)
TransformerFactory.newInstance();
XMLFilter filter = stf.newXMLFilter(new StreamSource("test.xslt"));
StreamResult sr = new StreamResult(System.out);
Transformer transformer = stf.newTransformer();
SAXSource transformSource = new SAXSource(filter, new InputSource
("test.xml"));

transformer.setParameter("testParam", "value");
transformer.transform(transformSource, sr);


The parameter is not passed to the stylesheet. It works when I just
transform the xml from the commandline (org.apache.xalan.xslt.Process).

When I had a look at the code I saw that for transformation chaining, the
TransformerIdentityImpl is used instead of the TransformerImpl. The
implementation of the setParameter()-method is quiet different. The method
in the TransformerIdentityImpl only seems to put the parameter in a
Hashtable, and that's it. I don't see any place in the code where this
Hashtable is used afterwards.

Is this a bug or am I not supposed to use the setParameter()-method when
doing transformation chaining? (or am I doing something wrong)


Thanks alot for any help,
Robbie



________________________________________________
DISCLAIMER

This e-mail and any attached files are confidential and may be legally
privileged. If you are not the addressee, any disclosure, reproduction,
copying, distribution, or other dissemination or use of this communication
is strictly prohibited. If you have received this transmission in error
please notify KBC immediately and then delete this e-mail.
KBC does not accept liability for the correct and complete transmission of
the information, nor for any delay or interruption of the transmission, nor
for damages arising from the use of or reliance on the information.
All e-mail messages addressed to, received or sent by KBC or KBC employees
are deemed to be professional in nature. Accordingly, the sender or
recipient of these messages agrees that they may be read by other KBC
employees than the official recipient or sender in order to ensure the
continuity of work-related activities and allow supervision thereof.






____________________________________________________
DISCLAIMER

This e-mail and any attached files are confidential and may be legally privileged. If you
are not the addressee, any disclosure, reproduction, copying, distribution, or other dissemination
or use of this communication is strictly prohibited. If you have received this transmission
in error please notify KBC immediately and then delete this e-mail.
KBC does not accept liability for the correct and complete transmission of the information,
nor for any delay or interruption of the transmission, nor for damages arising from the use
of or reliance on the information.
All e-mail messages addressed to, received or sent by KBC or KBC employees are deemed to be
professional in nature. Accordingly, the sender or recipient of these messages agrees that
they may be read by other KBC employees than the official recipient or sender in order to
ensure the continuity of work-related activities and allow supervision thereof.


Mime
View raw message