The same question was asked by someone else in an off-list message to Saxonica yesterday.

The PreparedStylesheet object was Serializable until Saxon 9.3, provided that you steered clear of facilities that weren't serializable, for example anything that required a RuleBasedCollator (a JDK class that for some reason isn't serializable). But the facility had so many restrictions, and caused so many problems, and so many disappointments, that we pulled it in 9.4, at the same time as we introduced bytecode generation.

Michael Kay

On 07/06/2012 15:48, Livia Hauser wrote:
Hi List,

a "  net.sf.saxon.value.DecimalValue" is thrown if I try to serialize a PreparedStylesheet.

My java code:
       TransformerFactoryImpl transFactory = new TransformerFactoryImpl();
        final String xsltPath = "path/to.xsl";
        FileReader fileReader = new FileReader(xsltPath);
        StreamSource sourceStream = new StreamSource(fileReader,xsltPath);
        PreparedStylesheet preparedStyleSheet = (PreparedStylesheet)transFactory.newTemplates(sourceStream);
        Assert.assertEquals(0, preparedStyleSheet.getErrorCount() );
        File fout = folder.newFile("path/to.sxx");
        OutputStream fos = new FileOutputStream(fout);
        ObjectOutputStream oos = new ObjectOutputStream( fos );
        oos.writeObject( preparedStyleSheet );
        System.out.println( "PreparedStylesheet is written to: " + fout.getAbsolutePath() );

Any hints?

Best Regards,

Ihr WEB.DE Postfach immer dabei: die kostenlose WEB.DE Mail App für iPhone und Android.

Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 

saxon-help mailing list archived at