Project

Profile

Help

Bug #2283

closed

s9api s9api transformation pipeline not working under .NET

Added by O'Neil Delpratt over 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Category:
.NET API
Sprint/Milestone:
Start date:
2015-01-13
Due date:
% Done:

100%

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

Description

The nunit test TestPipeline does not give any output under .NET.

See the code snippet below. no output reported.

                Processor proc = new Processor(false);
                XsltCompiler comp = proc.NewXsltCompiler();

                StringWriter sw = new StringWriter();
                Serializer out1 = new Serializer();
                out1.SetOutputWriter(sw);
                String xsl = "<xsl:stylesheet version='2.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>" +
                        "<xsl:template match='/'><a><xsl:copy-of select='.'/></a></xsl:template>" +
                        "</xsl:stylesheet>";
                String xml = "<z/>";
                XdmNode in1 = proc.NewDocumentBuilder().Build(new StringReader(xml));
                XsltTransformer stage1 = comp.Compile(new StringReader(xsl)).Load();
                XsltTransformer stage2 = comp.Compile(new StringReader(xsl)).Load();
                XsltTransformer stage3 = comp.Compile(new StringReader(xsl)).Load();
                XsltTransformer stage4 = comp.Compile(new StringReader(xsl)).Load();
                XsltTransformer stage5 = comp.Compile(new StringReader(xsl)).Load();
                //Uncomment when running under Saxon 9.6 and greater
                stage1.Destination = stage2;
                stage2.Destination = stage3;
                stage3.Destination = stage4;
                stage4.Destination = stage5;
                stage5.Destination = out1;
                stage1.InitialContextNode = in1; 
                stage1.Run(stage2);
                Assert.True(sw.ToString().Contains("<a><a><a><a><a><z/></a></a></a></a></a>"), "output");

Please register to edit this issue

Also available in: Atom PDF