Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • jayanthi 66 posts 86 karma points
    Sep 14, 2011 @ 16:04
    jayanthi
    0

    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

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 14, 2011 @ 16:43
    Fuji Kusaka
    0

    Hi Jayanthi,

    Can you try changing your xsl:output like this from

    <xsl:output method="html" indent="yes"  encoding="utf-8"/>

    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

  • jayanthi 66 posts 86 karma points
    Sep 14, 2011 @ 17:27
    jayanthi
    0

    Hi Fuji,

    No luck,i am facing the same error.I am using umbraco 4.7 and contour 1.0

  • jayanthi 66 posts 86 karma points
    Sep 14, 2011 @ 19:56
    jayanthi
    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

  • Frederik T 234 posts 345 karma points
    Sep 23, 2011 @ 11:08
    Frederik T
    0

    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.

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 23, 2011 @ 12:47
    Fuji Kusaka
    1

    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.

    <?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" 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"/>

    <xsl:param name="records"/>

    <xsl:template match="/">
    <!-- start writing XSLT -->

    <p> 
      Dear  <xsl:value-of select="$records//fields/child::* [caption = 'First Name']//value"/>&#160;<xsl:value-of select="$records//fields/child::* [caption = 'Last Name']//value"/>, your membership on our website.</p>
      <p><strong>Username</strong> : <xsl:value-of select="$records//fields/child::* [caption = 'Email']//value"/></p>
      <p><strong>Password</strong> : <xsl:value-of select="$records//fields/child::* [caption = 'Password']//value"/></p>
     

    </xsl:template>

    </xsl:stylesheet>

    Hope it will help you guys

     

    //fuji

  • Comment author was deleted

    Sep 23, 2011 @ 12:53

    There's also a razor alternative to the send transformed email: http://our.umbraco.org/projects/backoffice-extensions/send-razor-transformed-email-contour-workflow

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 23, 2011 @ 13:12
    Fuji Kusaka
    0

    Thanks Tim for this, nice solution.

     

  • Frederik T 234 posts 345 karma points
    Sep 23, 2011 @ 14:20
    Frederik T
    0

    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.

  • Frederik T 234 posts 345 karma points
    Sep 28, 2011 @ 10:07
    Frederik T
    0

    Sorry for bumping, but i really need help with this as its becoming an urgent issue.

  • Profiterole 232 posts 264 karma points
    Sep 28, 2011 @ 14:22
    Profiterole
    1

    Hi Jayanthi,

    Could you try this? This is the way I do it :

    <xsl:value-of select="$records/fields/firstname//value"/>
  • Frederik T 234 posts 345 karma points
    Sep 28, 2011 @ 14:38
    Frederik T
    0

    no, sorry, still doesnt work. I appreciate the help though, i have no idea why it wont work.

  • Comment author was deleted

    Sep 29, 2011 @ 09:06

    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

  • Frederik T 234 posts 345 karma points
    Sep 29, 2011 @ 10:01
    Frederik T
    0

    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

    Sep 29, 2011 @ 11:17

    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)

  • Frederik T 234 posts 345 karma points
    Sep 29, 2011 @ 11:26
    Frederik T
    0

    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

    Sep 29, 2011 @ 11:37

    Nope you need to simply upload it in the workflow settings.

    Guess that is what is going wrong

  • Frederik T 234 posts 345 karma points
    Sep 29, 2011 @ 12:15
    Frederik T
    0

    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.

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 29, 2011 @ 12:28
    Fuji Kusaka
    1

    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.

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheetversion="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:outputmethod="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"/>

    <xsl:paramname="records"/>

    <xsl:templatematch="/">
    <!-- start writing XSLT -->

    <p>  
      Dear  
    <xsl:value-ofselect="$records//fields/child::* [caption = 'First Name']//value"/>&#160;<xsl:value-ofselect="$records//fields/child::* [caption = 'Last Name']//value"/>, your membership on our website.</p>
     
    <p><strong>Username</strong> : <xsl:value-ofselect="$records//fields/child::* [caption = 'Email']//value"/></p>
     
    <p><strong>Password</strong> : <xsl:value-ofselect="$records//fields/child::* [caption = 'Password']//value"/></p>
     

    </xsl:template>

    </xsl:stylesheet>
  • Frederik T 234 posts 345 karma points
    Sep 29, 2011 @ 12:52
    Frederik T
    0

    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?

Please Sign in or register to post replies

Write your reply to:

Draft