[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
RE: [xsl] saxon to .net exslt problem
Subject: RE: [xsl] saxon to .net exslt problem From: "Houghton,Andrew" <houghtoa@xxxxxxxx> Date: Mon, 5 Nov 2007 12:53:41 -0500 |
> From: Don Smith [mailto:dsmith_lockesmith@xxxxxxxxx] > Sent: 05 November, 2007 12:08 > To: XSLT > Subject: [xsl] saxon to .net exslt problem > > I've developed an 1.0 transformation using the Saxon Java > engine. It uses the date() function from the exslt library. > Everything works fine. > > We're now trying to move this to a .NET 2.0 environment. > > This code snippet: > > System.Xml.Xsl.XslCompiledTransform xsl = new > System.Xml.Xsl.XslCompiledTransform(); > xsl.Load(xsltPath); > xsl.Transform(xmlPath, htmlPath); // THIS LINE THROWS AN ERROR > > throws this error: > > System.Xml.Xsl.XslTransformException: Cannot find the script > or external object that implements prefix > 'http://exslt.org/dates-and-times'. at. . .(I can include the > rest of this error message if necessary) You probably need to register the extension functions. The following code is based on EXSLT.NET (a defunct gotdot.net project), not Saxon, but the solution is probably similar: Dim urlResolver As New XmlUrlResolver Dim xmlDocument As New XmlDocument Dim xslDocument As New XslTransform Dim params As New XsltArgumentList xmlDocument.Load("file.xml") xslDocument.Load(xmlDocument, urlResolver, [Assembly].GetExecutingAssembly.Evidence) params.AddExtensionObject(ExsltNamespaces.Common, New ExsltCommon) params.AddExtensionObject(ExsltNamespaces.DatesAndTimes, New ExsltDatesAndTimes) params.AddExtensionObject(ExsltNamespaces.Math, New ExsltMath) params.AddExtensionObject(ExsltNamespaces.Random, New ExsltRandom) params.AddExtensionObject(ExsltNamespaces.RegularExpressions, New ExsltRegularExpressions) params.AddExtensionObject(ExsltNamespaces.Sets, New ExsltSets) params.AddExtensionObject(ExsltNamespaces.Strings, New ExsltStrings) params.AddExtensionObject(ExsltNamespaces.GDNDatesAndTimes, New GDNDatesAndTimes) params.AddExtensionObject(ExsltNamespaces.GDNDynamic, New GDNDynamic) params.AddExtensionObject(ExsltNamespaces.GDNMath, New GDNMath) params.AddExtensionObject(ExsltNamespaces.GDNRegularExpressions, New GDNRegularExpressions) params.AddExtensionObject(ExsltNamespaces.GDNSets, New GDNSets) params.AddExtensionObject(ExsltNamespaces.GDNStrings, New GDNStrings) xslDocument.Transform(xmlDocument, params, urlResolver) Andy.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] saxon to .net exslt probl, M. David Peterson | Thread | Re: [xsl] saxon to .net exslt probl, M. David Peterson |
Re: [xsl] saxon to .net exslt probl, Martin Honnen | Date | Re: [xsl] Find the node with maximu, Mukul Gandhi |
Month |