Project

Profile

Help

Cannot create TransformerFactory in Asp.Net

Added by Anonymous over 16 years ago

Legacy ID: #5164565 Legacy Poster: Masty (masty)

When I try and create a TransformerFactory as follows: java.lang.System.setProperty("javax.xml.transform.TransformerFactory", "net.sf.saxon.TransformerFactoryImpl"); TransformerFactory factory = TransformerFactory.newInstance(); The following exception is thrown: {"Provider net.sf.saxon.TransformerFactoryImpl not found"} [javax.xml.transform.TransformerFactoryConfigurationError]: {"Provider net.sf.saxon.TransformerFactoryImpl not found"} Data: {System.Collections.ListDictionaryInternal} HelpLink: null InnerException: null Message: "Provider net.sf.saxon.TransformerFactoryImpl not found" Source: "IKVM.OpenJDK.ClassLibrary" StackTrace: " at javax.xml.transform.TransformerFactory.newInstance [etc] The code works fine in a Windows Forms app, but not when run under ASP.Net. Ideas? Thanks Masty


Replies (4)

Please register to reply

RE: Cannot create TransformerFactory in Asp.N - Added by Anonymous over 16 years ago

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

I wouldn't attempt to use the Java APIs for Saxon when running under .NET. It's possible in theory but only if you know how to configure IKVM's dynamic loading of Java classes. Under .NET it's better to stick to Saxon's .NET API. Michael Kay Saxonica

RE: Cannot create TransformerFactory in Asp.Net - Added by Anonymous over 16 years ago

Legacy ID: #5166752 Legacy Poster: Masty (masty)

Thanks for your quick reply! I'm using the Java APIs because I can't get meaningful error information from the Saxon APIs. I catch the DynamicError that gets thrown from XsltTransformer.Run, but I only get messages like "Processing terminated by xsl:message at line -1" - nothing more detailed than that. Is there a way to attach a MessageEmitter (or something similar so I can get more detailed output) to an XsltTransformer? Thanks Masty

RE: Cannot create TransformerFactory in Asp.N - Added by Anonymous over 16 years ago

Legacy ID: #5169075 Legacy Poster: pvallone (pvallone)

I would stick with the .NET API. "You can capture compile-time XSLT errors using the ErrorList property of the XsltCompiler. " - See post http://sourceforge.net/forum/forum.php?thread_id=2160012&forum_id=94027 There is a c# example in the resources folder.

RE: Cannot create TransformerFactory in Asp.N - Added by Anonymous over 16 years ago

Legacy ID: #5169340 Legacy Poster: Masty (masty)

I think that would give me errors in the transform itself, but not the output from running the transform? I've figured it out though - had to use the MessageListener property of the XsltTransformer - no idea how I missed that in the API docs. Thanks for all your help!

    (1-4/4)

    Please register to reply