Hi Experts/Michael Kay
I got "Saxon.Api.DynamicError - Cannot find a matching 1-argument function named {exslt.org/common}node-set(). There is no Saxon extension function with the local name node-set" by using saxon9he - v9.4.0.2. My XSLT file is calling "EXSLT". please help me to resolve the issue.
public static StringWriter XSLT2(string sourceFile, string XSLT)
{
Processor processor = new Processor();
var setting = new XmlReaderSettings { DtdProcessing = DtdProcessing.Parse };
XmlReader reader2 = XmlReader.Create(sourceFile, setting);
XdmNode input = processor.NewDocumentBuilder().Build(reader2);
//XPathCompiler compiler = processor.NewXPathCompiler();
//compiler.DeclareNamespace("exsl", "http://exslt.org/common");
// Create a transformer for the stylesheet.
//Stream XsltTransformer transformer = processor.NewXsltCompiler().Compile(XSLT).Load();
XsltTransformer transformer = processor.NewXsltCompiler().Compile(new Uri(XSLT + @"\mekontopic.xsl")).Load();
transformer.InputXmlResolver = new XmlUrlResolver();
// Set the root node of the source document to be the initial context node
transformer.InitialContextNode = input;
// Create a serializer
StringWriter s = new StringWriter();
Serializer serializer = new Serializer();//serializer.SetOutputWriter(Console.Out);
serializer.SetOutputWriter(s);
// Transform the source XML to System.out.
transformer.Run(serializer);
return s;
}
Thanks in advance
SARAN