Hot to call C# function inside XSLT ?

  • Thread starter Thread starter Maxim Kazitov
  • Start date Start date
here is a short sample that should get you started

<xsl:for-each select="Ledger/*"><xsl:value-of select="user:Total(.))"/
xsl:for-each><msxsl:script implements-prefix='user' language='C#'
decimal balance = 0

void Total(XPathNodeIterator iter)
XmlNode node = e.NextNode()
string s = node.SelectSingleNode("amount").InnerText
decimal amount = Decimal.Parse(s)
if (node.Name == “deposit†|| node.Name == “balanceâ€
balance += amount
els
balance -= amount
return balance

]]
msxsl:script

ht
jayson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

xslt and .net 1
xslt 2
XSLT query 2
XSLT to PDF 22
XSLT to EMF 10
Suppress the security warning bar when using the WebBrowser control. 0
Print XML suggestion 2
Transform xml to *.txt in C# app. 3

Back
Top