I am bumping this because i have the exact same problem. I tried both examples in the post linked to above, and i get the same error. I sadly do now know of a solution and it seems like it isnt resolved here in the forum.
Here is the full sample code of my XSLT which works perfectly. However please make sure you put the same exact Alias used in contour since this is case sensitive.
Thank you for your reply, Fuji, i also tried using your code, but it still gives me the error. "System.Xml.Xsl.XslTransformException: Expression must evaluate to a node-set." Even if i do something as simple as this:
Thank you for your reply. I found the simple example that came with the contour package, and it still gives the same "must evaluate to a node set" error.
All examples posted here, and the example packaged with contour, compiles fine if i dont reference $records.
It is strange indeed, and we are using umbraco 4,7 and the latest (as of writing) version of contour. I have close to zero experience with razor, but i will give it a try and see if anything happens.
Just to be absolutly sure:
The xslt i want to use for the email, i just place it in "Developer" --> "XSLT Files" like any other xslt file, right? And a related macro? Is it necessary? do i need to give it anything specific if so?
I know its a simple question but i need to be sure i have every corner covered.
Ok, now i understand. I feel so stupid right now. I appreciate your time. Though ive run into a new problem.
I tried creating an external xslt file using the contour sample file. I uploaded it through the workflow, but it wasnt sent. I tried clicking "Show current file" in the workflow dialog box, and it displayed the following error:
XML Parsing Error: prefix not bound to a namespace removed
Im sure im missing something obvious.
EDIT (i edited the code above because it contained sensitive information)
Ok disregard im an idiot. That error above was the browsers fault. Besides, i used the example show in this thread on page 1 and changed the text. It then gave another error, that was related to the encoding that i changed to iso-8859-1 because i use æøå characters. Then another odd error which i fixed and it all works now.
I could bang my head against the wall right now. I greatly appreciate your help, altough it ended up being something completly different, you pointed me in the right direction so thank you :) since this isnt my thread i cant mark it solved or anything, i will high five you instead.
the function im working on, is a "tip a friend" functionality. When a user clicks the button, a lightbox with an iframe to the contour form pops up. To create the url that is sent with the email, a value is appended to the url like so:
<a class="iframe" title="Tip en ven"><xsl:attribute name="href">/pro/tip-en-ven.aspx?id=<xsl:value-of select="$Service/Job/JobID" /></xsl:attribute>Tip en ven</a>
Which i then append to the url in the workflow. Note this is done with the regular "send email" workflow built into contour at it works fine with the url, iframe lightbox and all that.
XSLT transformed Email-Expression must evaluate to a node-set.
I am getting error(Expression must evaluate to a node-set) when using xslt transformed email in contour
<?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"
xmlns:user="urn:my-scripts"
xmlns:umbraco.library="urn:umbraco.library" exclude-result-prefixes="xsl msxsl user umbraco.library">
<xsl:output method="html" indent="yes" encoding="utf-8"/>
<xsl:param name="records" />
<xsl:template match="/">
<table style="border-collapse:collapse;border:1px solid black;">
<xsl:value-of select="$records//fields/child::*[caption = 'First Name']"/>
</table>
</xsl:template>
</xsl:stylesheet>
Please help me
Hi Jayanthi,
Can you try changing your xsl:output like this from
to
<xsl:output method="html" media-type="text/html" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="DTD/xhtml1-strict.dtd" cdata-section-elements="script style" indent="yes" encoding="utf-8"/>
//fuji
Hi Fuji,
No luck,i am facing the same error.I am using umbraco 4.7 and contour 1.0
hi all,
Even the sample code given in the link http://our.umbraco.org/forum/umbraco-pro/contour/18103-Send-xslt-transformed-email-Here-is-my-xslt-email-template
is not working for me.the error with this line '$records//fields/child::*'
I am saving the xslt in the developer-->xslt files(umbraco-4.7 and contour-1.0)
Can anyone help me
I am bumping this because i have the exact same problem. I tried both examples in the post linked to above, and i get the same error. I sadly do now know of a solution and it seems like it isnt resolved here in the forum.
Hi Frederik,
Here is the full sample code of my XSLT which works perfectly. However please make sure you put the same exact Alias used in contour since this is case sensitive.
Hope it will help you guys
//fuji
Comment author was deleted
There's also a razor alternative to the send transformed email: http://our.umbraco.org/projects/backoffice-extensions/send-razor-transformed-email-contour-workflow
Thanks Tim for this, nice solution.
Thank you for your reply, Fuji, i also tried using your code, but it still gives me the error. "System.Xml.Xsl.XslTransformException: Expression must evaluate to a node-set." Even if i do something as simple as this:
<xsl:value-of select="$records//fields/child::* [caption = 'Din email']//value"/>
I must have overseen something obvious.
Sorry for bumping, but i really need help with this as its becoming an urgent issue.
Hi Jayanthi,
Could you try this? This is the way I do it :
no, sorry, still doesnt work. I appreciate the help though, i have no idea why it wont work.
Comment author was deleted
Hey Frederik,
And if you start from the example that comes with Contour do you get the error?
Would just take it from there then
Thank you for your reply. I found the simple example that came with the contour package, and it still gives the same "must evaluate to a node set" error.
All examples posted here, and the example packaged with contour, compiles fine if i dont reference $records.
Comment author was deleted
That's strange, and have you tried the Razor alternative? http://our.umbraco.org/projects/backoffice-extensions/send-razor-transformed-email-contour-workflow
(must be running at least umbraco 4.7 for that)
It is strange indeed, and we are using umbraco 4,7 and the latest (as of writing) version of contour. I have close to zero experience with razor, but i will give it a try and see if anything happens.
Just to be absolutly sure:
The xslt i want to use for the email, i just place it in "Developer" --> "XSLT Files" like any other xslt file, right? And a related macro? Is it necessary? do i need to give it anything specific if so?
I know its a simple question but i need to be sure i have every corner covered.
Comment author was deleted
Nope you need to simply upload it in the workflow settings.
Guess that is what is going wrong
Ok, now i understand. I feel so stupid right now. I appreciate your time. Though ive run into a new problem.
I tried creating an external xslt file using the contour sample file. I uploaded it through the workflow, but it wasnt sent. I tried clicking "Show current file" in the workflow dialog box, and it displayed the following error:
XML Parsing Error: prefix not bound to a namespace
removed
Im sure im missing something obvious.
EDIT (i edited the code above because it contained sensitive information)
Ok disregard im an idiot. That error above was the browsers fault. Besides, i used the example show in this thread on page 1 and changed the text. It then gave another error, that was related to the encoding that i changed to iso-8859-1 because i use æøå characters. Then another odd error which i fixed and it all works now.
I could bang my head against the wall right now. I greatly appreciate your help, altough it ended up being something completly different, you pointed me in the right direction so thank you :) since this isnt my thread i cant mark it solved or anything, i will high five you instead.
Hey Frederik,
Sorry to bump into this, did you create a clean XSLT?
Anyway try this, its just an example of how i got mine working.
Ok one final question:
the function im working on, is a "tip a friend" functionality. When a user clicks the button, a lightbox with an iframe to the contour form pops up. To create the url that is sent with the email, a value is appended to the url like so:
<a class="iframe" title="Tip en ven"><xsl:attribute name="href">/pro/tip-en-ven.aspx?id=<xsl:value-of select="$Service/Job/JobID" /></xsl:attribute>Tip en ven</a>
Which i then append to the url in the workflow. Note this is done with the regular "send email" workflow built into contour at it works fine with the url, iframe lightbox and all that.
How do i do the same in an xslt?
is working on a reply...