the xsl code is the following
<xsl:template match="/">
<xsl:for-each select="/t:Flow/t:AccountingRecords/t:AccountingRecord">
<xsl:result-document method="xml" href="UBL-invoice.2.1-{t:Reference}-output.xml">
<xsl:apply-templates select="."/>
</xsl:result-document>
</xsl:for-each>
</xsl:template>
My code is quite the one from the samples
Processor proc = new Processor();
var comp = proc.NewXsltCompiler();
Xslt30Transformer exe = comp.Compile(new Uri("file:///" + System.IO.Path.GetFullPath("./Styles/style.xslt"))).Load30();
var baseOutUri = new System.Uri(Directory.GetCurrentDirectory());
exe.BaseOutputURI = baseOutUri.AbsoluteUri;
Console.WriteLine(exe.BaseOutputURI);
DocumentBuilder builder = proc.NewDocumentBuilder();
builder.BaseUri = new Uri("file:///" + System.IO.Path.GetFullPath("./ar2.xml"));
XdmNode inp = builder.Build(System.IO.File.OpenRead(System.IO.Path.GetFullPath("./ar2.xml")));
Serializer serializer = proc.NewSerializer();
serializer.SetOutputWriter(Console.Out);
// Transform the source XML and serialize the result document
exe.ApplyTemplates(inp, serializer); // < ==== Exception here
The Console.WriteLine writes:
file:///D:/dev/fromSvn/cclb/bas/bin/debug
But the outputs are generated in:
D:\dev\fromSvn\cclb\bas\bin
If I want to fix this I have to modify my code to:
exe.BaseOutputURI = baseOutUri.AbsoluteUri + "/";
M'I correct or do I miss something ?