From: AUBRY, S. (COFRAMI) <ste...@ai...> - 2005-11-08 10:47:52
|
hi all, Excuse me but i want to use your SAXON.NET 1.0 RC1 files in my application (C# Project). Unfortunately, an error occur during the application ! "gnu.xml.domLSException : Protocol handler not found : c" Have you got an idea ? using System; using System.IO; using System.Xml; using javax.xml.transform; using javax.xml.transform.stream; using net.sf.saxon; namespace RulesToHtml { /// <summary> /// Summary description for XSL. /// </summary> public class XSL { //Constructors public XSL(){ } public void Transform(string inXML, string inXSL, string output) { StreamSource inputXml_Source = new StreamSource(new java.io.FileInputStream(inXML)); inputXml_Source.setSystemId(inXML); StreamSource inputXsl_Source = new StreamSource(new java.io.FileInputStream(inXSL)); inputXsl_Source.setSystemId(inXSL); StreamWriter sw = new StreamWriter(output); sw.Write(DoTransform(inputXml_Source, inputXsl_Source)); sw.Close(); } private static string DoTransform(StreamSource Xml, StreamSource Xsl) { java.lang.System.setProperty("javax.xml.transform.TransformerFactory", "net.sf.saxon.TransformerFactoryImpl"); StreamResult outResult = new StreamResult(); java.io.ByteArrayOutputStream outputXmlResult = new java.io.ByteArrayOutputStream(); outResult.setOutputStream(outputXmlResult); TransformerFactory trans = TransformerFactory.newInstance(); Transformer transformer = trans.newTransformer(Xsl); transformer.transform(Xml,outResult); return outputXmlResult.toString(); } } } Thanks ? This e-mail is intended only for the above addressee. It may contain privileged information. If you are not the addressee you must not copy, distribute, disclose or use any of the information in it. If you have received it in error please delete it and immediately notify the sender. Security Notice: all e-mail, sent to or from this address, may be accessed by someone other than the recipient, for system management and security reasons. This access is controlled under Regulation of Investigatory Powers Act 2000, Lawful Business Practises. |