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
Saxonica


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

a "java.io.NotSerializableException:  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 );
        oos.close();
        System.out.println( "PreparedStylesheet is written to: " + fout.getAbsolutePath() );

Any hints?


Best Regards,
Liv
  

Ihr WEB.DE Postfach immer dabei: die kostenlose WEB.DE Mail App für iPhone und Android.   
https://produkte.web.de/freemail_mobile_startseite/


------------------------------------------------------------------------------
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 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help