Project

Profile

Help

Support #1645

Please help for xslt 2.0 saxon .net (Index was outside bounds of array)

Added by kubix kenan almost 4 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
.NET API
Sprint/Milestone:
-
Start date:
2012-11-13
Due date:
% Done:

0%

Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Found in version:

Description

Hi
My C# codes
Processor xsltProcessor = new Processor();
XdmNode input = xsltProcessor.NewDocumentBuilder().Wrap(doc); XsltTransformer transformer = xsltProcessor.NewXsltCompiler().Compile(new Uri(HttpContext.Current.Server.MapPath(xsltPath))).Load(); transformer.InitialContextNode = input;
Serializer serializer = new Serializer();
MemoryStream stream = new MemoryStream(); serializer.SetOutputStream(stream);
transformer.Run(serializer); stream.Position = 0; StreamReader read = new StreamReader(stream); return read.ReadToEnd();
test.xslt
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="fn"
exclude-result-prefixes="xs fn">
<xsl:output method="html" indent="yes"/>
<xsl:template match="/">
<table>
<tr>
<td>id</td>
<td>test 1</td>
<td>test 2</td>
</tr>
<xsl:apply-templates select="//item"></xsl:apply-templates>
</table>
</xsl:template>
<xsl:template match="item">
<tr>
<td>

<xsl:value-of select="replace(id, '1', 'bir')"/>
</td>
<td>

<xsl:value-of select="customerame"/>
</td>
<td>
<xsl:value-of select="adres"/>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
transformer.Run(serializer); line is throwing error : Index was outside bounds of array.
Please help;
Best regards

History

#1 Updated by kubix kenan almost 4 years ago

resolved

#2 Updated by Michael Kay over 3 years ago

  • Tracker changed from Bug to Support

#3 Updated by Michael Kay over 3 years ago

  • Status changed from New to Resolved
  • Priority changed from High to Normal

User has reported this problem resolved, though we don't know the resolution.

Also available in: Atom PDF