Project

Profile

Help

Transform Recoverable Error Warning Level

Added by Anonymous about 14 years ago

Legacy ID: #8037374 Legacy Poster: bgprogrammer (bgivner)

How do I set the RECOVER_POLICY feature when using the net.sf.saxon.Transform class from within an application. i.e. not using the command line option "-w0" It does not help to set the factory attribute, as below, since the Transform class is not created by the factory. factory.setAttribute(FeatureKeys.RECOVERY_POLICY, new Integer(Configuration.RECOVER_SILENTLY)); The following is my code: TransformerFactoryImpl factory = new TransformerFactoryImpl(); Transform t = new net.sf.saxon.Transform(); Templates sheet = factory.newTemplates(xslSource); t.processFile(source, sheet, outputFile, params, null, null, null);


Replies (4)

Please register to reply

RE: Transform Recoverable Error Warning Level - Added by Anonymous about 14 years ago

Legacy ID: #8038684 Legacy Poster: bgprogrammer (bgivner)

This is resolved.

RE: Transform Recoverable Error Warning Level - Added by Anonymous about 14 years ago

Legacy ID: #8040145 Legacy Poster: Michael Kay (mhkay)

You should not be using the net.sf.saxon.Transform class from your own Java application. If you are using the JAXP concepts of TransformerFactory and Templates, then you should be using a JAXP Transformer object generated from the Templates object that represents the compiled stylesheet.

RE: Transform Recoverable Error Warning Level - Added by Anonymous about 14 years ago

Legacy ID: #8043021 Legacy Poster: bgprogrammer (bgivner)

Thanks. This particular transformation does not have an output target, but rather results in one or more files being written. The stylesheet has the following markup: <xsl:result-document href="{$filename}" format="html"> Therefore, does it make sense to use the javax.xml.transform.Transformer object, since the only method available seems to be Transformer.transform(Source xmlSource, Result outputTarget) and in this case, there is no outputTarget for the transformation.

RE: Transform Recoverable Error Warning Level - Added by Anonymous about 14 years ago

Legacy ID: #8043562 Legacy Poster: Michael Kay (mhkay)

Many aspects of the JAXP interface are rather oriented to XSLT 1.0 thinking. You can use JAXP if you want (just create a dummy Result object - the systemId will be used as the base URI for resolving the href in xsl:result-document). But if you want something more oriented to XSLT 2.0 and specifically to Saxon capabilities, the s9api interface is better.

    (1-4/4)

    Please register to reply