Project

Profile

Help

Bug #4794

Output method saxon:base64Binary throws exception

Added by Jiri Dolejsi 7 days ago. Updated 7 days ago.

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

0%

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

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();

    }
}

}`

History

#1 Updated by Michael Kay 7 days ago

  • Category set to Saxon extensions
  • Assignee set to O'Neil Delpratt

Please register to edit this issue

Also available in: Atom PDF