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

    }
}

}`

Actions #1

Updated by Michael Kay over 3 years ago

  • Category set to Saxon extensions
  • Assignee set to O'Neil Delpratt
Actions #2

Updated by Michael Kay over 3 years ago

  • Status changed from New to In Progress
  • Assignee changed from O'Neil Delpratt to Michael Kay

I've added JUnit test TestSerializer/testBinarySerialization and I'm getting the same error on the Java platform.

Actions #3

Updated by Michael Kay over 3 years ago

At SerializerFactory#309 we're expecting the method name to be a Clark name {uri}local but it's actually an EQName (Q{uri}local).

Note that the constants in SaxonOutputKeys are Clark names.

I'm inclined to do some lazy programming here and accept either format.

Actions #4

Updated by Michael Kay over 3 years ago

  • Status changed from In Progress to Resolved
  • Applies to branch 10, trunk added
  • Fix Committed on Branch 10, trunk added

Fixed.

Actions #5

Updated by O'Neil Delpratt over 3 years ago

Bug fix applied in the Saxon 10.3 maintenance release

Actions #6

Updated by O'Neil Delpratt over 3 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 10.3 added

Please register to edit this issue

Also available in: Atom PDF