You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Jason Harrop <ja...@xn.com.au> on 2001/10/31 18:13:20 UTC

Can't get TransformerHandlerImpl from XMLFilter with getContentHandler?

Hi

I'm using XMLFilters.  I'd like to set stylesheet parameters on the 
underlying transformer.

Here's a code snippet which shows how i'm trying to do it:

     XMLFilter myFilter = SAXTransformerFactory.newXMLFilter( 
myTemplatesObject);

     org.apache.xalan.transformer.TransformerHandlerImpl handler = 
 
(org.apache.xalan.transformer.TransformerHandlerImpl)myFilter.getContentHandler();

      if ( handler!=null) {
          Transformer transformer = handler.getTransformer();

          // set away to your heart's content
          transformer.setParameter("testString", new String("predictable 
contents..") );
      } else {
          log.error("Couldn't get transformer for XMLFilter object :( ");
      }

The problem is, the handler is always null.

Has anybody got something like this to work?

I'm using Xalan from cvs sources, built a few mins ago.

thanks

Jason