Michael,

Thanks for the hints. I finally figured out how to silence the warnings from JTSL/Saxon transforms. This will also allow me to use all the Configuration options of Saxon within JSP/JSTL.

--Rich


Details, for those who care:
================

I defined a class:

/**
 * Override Saxon TransformerFactory to prevent "Recoverable error" in stdout
 * We don't want to see "Recoverable error XTRE0540: Ambiguous rule match" in Tomcat's catalina.out
 *
 * @author fozzard
 */
public class RecoverSilentlyTransformerFactoryImpl extends net.sf.saxon.TransformerFactoryImpl {

    private Configuration config;

    /**
    * Default constructor.
    */
    public RecoverSilentlyTransformerFactoryImpl() {
        config = new Configuration();
        config.setProcessor(this);
        setAttribute( FeatureKeys.RECOVERY_POLICY_NAME, "recoverSilently");
    }

    /**
    * Construct a TransformerFactory using an existing Configuration.
    * @param config the Saxon configuration
    */
    public RecoverSilentlyTransformerFactoryImpl(Configuration config) {
        this.config = config;
        setAttribute( FeatureKeys.RECOVERY_POLICY_NAME, "recoverSilently");
    }
   
}


and added this to my JSP:

    //override Saxon TransformerFactory to prevent "Recoverable error" in stdout (Tomcat's catalina.out)
    System.setProperty("javax.xml.transform.TransformerFactory", "gov.noaa.nmmrview.RecoverSilentlyTransformerFactoryImpl");



Richard Fozzard, Computer Scientist
  Geospatial Metadata at NGDC: http://www.ngdc.noaa.gov/metadata

Cooperative Institute for Research in Environmental Sciences (CIRES)
Univ. Colorado & NOAA National Geophysical Data Center, Enterprise Data Systems 
325 S. Broadway, Skaggs 1B-305, Boulder, CO 80305
Office: 303-497-6487, Cell: 303-579-5615, Email: richard.fozzard@noaa.gov


Michael Kay said the following on 06/04/2010 01:58 PM:
On 04/06/2010 19:23, Richard Fozzard wrote:
  
I don't understand where to get "the Configuration" or the "Processor"
objects, so that I can call setConfigurationProperty().

I'm not explicitly calling the TransformerFactory (the JSTL tag
<x:transform>  does this somehow), and so I don't have either Saxon
object within the JSP itself.

Is it even possible to set Configuration properties when using JSTL
tags? Will I have to rewrite this as plain Java without the tags?

Thanks,
--Rich

   
    
I'm no expert on JSTL, but as far as I can see it doesn't give you the 
opportunity to set any configuration properties - not even an 
ErrorListener. Seems very restrictive.

So I'm afraid you'll have to drop down into Java coding.

If you want to avoid changing your JSTL code, you could define a 
subclass of net.sf.saxon.TransformerFactoryImpl that makes the 
appropriate setAttribute() calls on initialization, and then you could 
cause your JSTL code to use your own TransformerFactory rather than the 
standard one - I'm not sure how you currently get it to pick up Saxon 
rather than Xalan, but the same approach might work.

Michael Kay
Saxonica

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help