below is the code I use to bind my xml file to xsl and produce my pdf-file. This all works great. doc_xml.Load(Server.MapPath("xmltest.xml")); pdf1.BindXML(doc_xml, Server.MapPath("xsltfile.xsl")); pdf1.Save("c:\\H.pdf");
I was perfectly able to create a " xsl:variable " and work with it. ==> works good.
It is just, that I think that Aspose.pdf does not support the " node-set() " Is there a way in Aspose.pdf to calculate an overal sum. (i've looked at Formfields, but nothing seems to do the trick).
In fact, the code in my upper post is used in Aspose.Pdf to process xslt and xml. I don’t know how to support msxsl:node-set when transform xml with xslt. Aspose.Pdf use the final xml to produce pdf file. I will study this issue. If you know the answer, please tell me.
Using "xsl.Transform" and the stylesheet with the "<Pdf xmlns="Aspose.Pdf">" element the result is NOT good Commenting out the "<Pdf xmlns="Aspose.Pdf">" and running the transform results in an perfect outcome. So, the problem lays in the tag. ==> any solutions?
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt"> <xsl:template match="/"> ==> RESULT of xsl Transform is OK <xsl:for-each select="rapporten/rapport"> <xsl:variable name="tmpTotal"> <xsl:for-each select="vakken/vak"> <puntenDW> <xsl:value-of select="puntenDW div 100 * tebehalenDW"/> </puntenDW> <tebehalenDW> <xsl:value-of select="tebehalenDW"/> </tebehalenDW> </xsl:for-each> </xsl:variable> <xsl:variable name="totpuntenDW"> <xsl:value-of select="sum(msxsl:node-set($tmpTotal)/puntenDW)"/> </xsl:variable> <xsl:variable name="tottebehalenDW"> <xsl:value-of select="sum(msxsl:node-set($tmpTotal)/tebehalenDW)"/> </xsl:variable> <Section> <Text> <Segment> totaal:<xsl:value-of select="$totpuntenDW div $tottebehalenDW * 100"/> </Segment> </Text> </Section> </xsl:for-each>