One other thing to note:

> and/or Saxon.NET-1.0-RC1

This release, if not already, needs to be taken out back and buried with a shovel (after first using the same shovel to put it out of your misery)

This release was from over a year ago, and from WELL before Dr. Kay took Saxon.NET under the wings of Saxonica to be properly nurtured and brought into sync with the latest Saxon code base as well as to give it its own native .NET-based API.

On 5/11/06, Michael Kay <mike@saxonica.com> wrote:

The general position in Saxon on .NET is:

* there's no support for dynamic loading of user hooks (extension functions,
OutputURIResolvers etc) written as .NET assemblies

* there's limited support for dynamic loading of such user hooks written in
Java.

I *think* that the rule for Java is essentially that when Saxon attempts to
load Java code dynamically, the request will succeed if the code is already
loaded. This means, for example, that the extension functions provided with
the Saxon product work, because they are incorporated in the JAR file
itself. It might be possible to exploit this fact to get user-written hooks
to work.

Dynamic loading of .NET assemblies is high on the requirements list for a
future release. Since it's a significant work package it would be nice to
find someone to sponsor the development.

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: saxon-help-admin@lists.sourceforge.net
> [mailto:saxon-help-admin@lists.sourceforge.net ] On Behalf Of
> Maxim Ryvkin
> Sent: 10 May 2006 08:45
> To: saxon-help@lists.sourceforge.net
> Subject: [saxon] OutputURIResolver on .NET 2.0 (C#)
>
> Hi.
> I'm using Saxon Saxon-B 8.7.2 for .NET (and/or
> Saxon.NET-1.0-RC1) with MS VisualStudio 8 (C#).
> When I try to supply a custom OutputURIResolver to handle
> secondary result stream in memory an error occurs in
> javax.xml.transform.Transformer.transform(...);
> What is wrong with source code? Is there any working samples
> of using OutputURIResolver on .NET 2.0?
>
> Thanks a lot, regards, Max Ryvkin.
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> public class MyOutputUriResolver : net.sf.saxon.OutputURIResolver {
>        public void close(javax.xml.transform.Result result) {}
>
>        public javax.xml.transform.Result resolve(
>               System.String href,
>               System.String baseUri)
>        {
>               return null;
>        }
> }
>
> public System.String DoTransform(System.String xml,
> System.String xslt) {
>        string re;
>        try
>        {
>
> java.lang.System.setProperty("javax.xml.transform.TransformerF
> actory", "net.sf.saxon.TransformerFactoryImpl");
>
>               javax.xml.transform.stream.StreamResult resultS
> = new StreamResult();
>               java.io.ByteArrayOutputStream bstream = new
> java.io.ByteArrayOutputStream();
>               resultS.setOutputStream(bstream);
>
>               javax.xml.transform.TransformerFactory tx =
>
> javax.xml.transform.TransformerFactory.newInstance ();
>
>               // Something wrong?
>
> tx.setAttribute("http://saxon.sf.net/feature/outputURIResolver
> ", new MyOutputUriResolver());
>
>               javax.xml.transform.stream.StreamSource xmlS =
>                      = new
> javax.xml.transform.stream.StreamSource(new
> java.io.StringReader(xml)); }
>               javax.xml.transform.stream.StreamSource xsltS =
>                      = new
> javax.xml.transform.stream.StreamSource(new
> java.io.StringReader(xslt)); }
>
>               javax.xml.transform.Transformer transformer =
> tx.newTransformer(xsltS);
>
>               //
> ((net.sf.saxon.Controller)transformer).setOutputURIResolver(ne
> w MyOutputUriResolver());
>
>               transformer.transform (xmlS, resultS);
>
>               re = bstream.toString();
>       }
>       catch (TransformerException tex)
>       {
>               re = tex.Message;
> /* saxon8.dll v 8.7.2.1
> [net.sf.saxon.trans.DynamicError]     {""}
> net.sf.saxon.trans.DynamicError
> HResult       -2146233088 int
> containedException    {""}    System.Exception
> { org.xml.sax.SAXParseException}
> Source        "IKVM.GNU.Classpath"    string
> StackTrace    "   at
> gnu.xml.stream.SAXParser.parse(InputSource input)\r\n   at
> net.sf.saxon.event.Sender.sendSAXSource (SAXSource saxs,
> Receiver r, Int32 i1, Int32 i2)"      string
> TargetSite    {Void parse(org.xml.sax.InputSource)}
> System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}
> *
> _COMPlusExceptionCode -532459699      int
> */
>        }
>        catch (Exception ex)
>        {
>               re = ex.Message;
> /* Saxon.NET.dll v 1.0-RC1
> [System.TypeLoadException ]    {"Method
> 'java.lang.Comparable/compareTo(Ljava.lang.Object;)I' on type
> 'net.sf.saxon.value.CalendarValue' from assembly 'Saxon.NET,
> Version=0.2.8.3, Culture=neutral,
> PublicKeyToken=039082bc3d203ffd' is overriding a method that
> has been overridden.":"net.sf.saxon.value.CalendarValue"}
> System.TypeLoadException
> */
>        }
>        return re;
> }
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="2.0"
> xmlns:xsl=" http://www.w3.org/1999/XSL/Transform">
>       <xsl:output method="text" />
>       <xsl:template match="/">
>       This is the main output
>               <xsl:result-document href=" file://some/path">
>                       I'm interested to handle such an output.
>               </xsl:result-document>
>       </xsl:template>
> </xsl:stylesheet>
>
>
>
>
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web
> services, security?
> Get stuff done quickly with pre-integrated technology to make
> your job easier Download IBM WebSphere Application Server
> v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=k&kid0709&bid&3057&dat1642
> _______________________________________________
> saxon-help mailing list
> saxon-help@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/saxon-help



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmdlnk&kid0709&bid&3057&dat1642
_______________________________________________
saxon-help mailing list
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help



--
<M:D/>

M. David Peterson
http://www.xsltblog.com/