Project

Profile

Help

Bug #4794

closed

Output method saxon:base64Binary throws exception

Added by Jiri Dolejsi over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Saxon extensions
Sprint/Milestone:
-
Start date:
2020-10-16
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
10, trunk
Fix Committed on Branch:
10, trunk
Fixed in Maintenance Release:
Platforms:

Description

.NET 4.7, SaxonEE 10.2 Exception - Saxon.Api.DynamicError: Cannot create user-supplied output method. Failed to load base64Binary

`using System; using Saxon.Api; using System.IO;

namespace TestSaxon { class Program { static Processor processor = new Processor(true);

    static String xslt =
    @"<xsl:transform version='3.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:saxon='http://saxon.sf.net/'>" +
    @"<xsl:output method='saxon:base64Binary'/>" +
    @"<xsl:template name = 'xsl:initial-template'>" +
    @"<xsl:text>iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAA" +
    @"LEwAACxMBAJqcGAAAAAd0SU1FB9YGARc5KB0XV+IAAAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBH" +
    @"SU1Q72QlbgAAAF1JREFUGNO9zL0NglAAxPEfdLTs4BZM4DIO4C7OwQg2JoQ9LE1exdlYvBBeZ7jqch9//q1uH" +
    @"4TLzw4d6+ErXMMcXuHWxId3KOETnnXXV6MJpcq2MLaI97CER3N0vr4MkhoXe0rZigAAAABJRU5ErkJggg==" +
    @"</xsl:text>" +
    @"</xsl:template>" +
    @"</xsl:transform>";


    static void Main()
    {

        XsltCompiler comp = processor.NewXsltCompiler();
        Xslt30Transformer transformer = comp.Compile(new StringReader(xslt)).Load30();
        Serializer ser = processor.NewSerializer();
        MemoryStream ms = new MemoryStream();
        ser.SetOutputStream(ms);
        transformer.CallTemplate(null, ser);
        var x = ms.ToArray();

    }
}

}`

Please register to edit this issue

Also available in: Atom PDF