Copied to clipboard

Flag this post as spam?

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

  • Ron Brouwer 273 posts 768 karma points
    Nov 17, 2009 @ 12:42
    Ron Brouwer

    Error parsing XSLT file

    Hi Warren,

    First of all I love this package!
    However at the moment (it did work and no errors occurred) it is causing the well known "Error parsing XSLT file". And I can't find the problem, I know it goes wrong when using CWS.Twitter:, because when I just read directly from xml it works.

    The template that I use:

    <xsl:template match="status" mode="tweet">
        <!-- Change the XHTML here for how you want each tweet to be displayed -->
        <div class="block-content">
            <xsl:value-of select="CWS.Twitter:FormatURLS(text)" disable-output-escaping="yes"/>
          <small class="note">
            <xsl:value-of select="umbraco.library:FormatDateTime(CWS.Twitter:FormatTwitterDate(created_at), 'ddd d MMM yy @ H:mm')"/> from <xsl:value-of select="source" disable-output-escaping="yes"/>

    The XML that is feched from Twitter:

    <statuses type="array">
        <created_at>Mon Nov 16 18:06:18 +0000 2009</created_at>
        <text>Morgen 17/11 partnervergadering in Convention Factory met info over (promo) activiteiten in 2009 en 2010 en profiteer van Giro en Sail</text>
        <in_reply_to_status_id />
        <in_reply_to_user_id />
        <in_reply_to_screen_name />
          <name>VVV Amsterdam</name>
          <description />
          <created_at>Mon May 18 11:40:36 +0000 2009</created_at>
          <notifications />
          <following />
        <geo />


    Any help will be much appriciated!


  • Chris Houston 533 posts 978 karma points MVP admin c-trib
    Nov 17, 2009 @ 14:58
    Chris Houston

    Hi Ron,

    If I understood you correctly this did work and has just stopped working?

    So it's likely to be something different with the current XML received from twitter, have you tried breaking the XSLT down so that it only calls one of Warren's XSLT extensions to see if you only get the error with one of them?

    I assume you have following in the xsl:stylesheet:


    And in the exclude=result-prefixes:


    I have currently replaced Warren's function call FormatURLS with the following XSLT template, we are currently working on a new version that will include this within the function, but for now you might wish to do the same.

    I.e. replace:

    <xsl:value-of select="CWS.Twitter:FormatURLS(text)" disable-output-escaping="yes"/>


    <xsl:call-template name="formaturl">
     <xsl:with-param name="url" select="text"/>

    And then add the following xsl:template

       <xsl:template name="formaturl">
    <xsl:param name="url"/>
    <xsl:variable name="transform-http" select="Exslt.ExsltRegularExpressions:replace($url, '(http\:\/\/\S+)',ig,'&lt;a href=&quot;$1&quot;&gt;$1&lt;/a&gt;')"/>
    <xsl:variable name="transform-https" select="Exslt.ExsltRegularExpressions:replace($transform-http, '(HTTps\:\/\/\S+)',ig,'&lt;a href=&quot;$1&quot;&gt;$1&lt;/a&gt;')"/>
    <xsl:variable name="transform-AT" select="Exslt.ExsltRegularExpressions:replace($transform-https, '(^|\s)@(\w+)',ig,' &lt;a href=&quot;$2&quot;&gt;@$2&lt;/a&gt;')"/>
    <xsl:variable name="transform-HASH" select="Exslt.ExsltRegularExpressions:replace($transform-AT, '(^|\s)#(\w+)',ig,' &lt;a href=&quot;$2&quot;&gt;#$2&lt;/a&gt;')"/>
    <xsl:value-of select="$transform-HASH" disable-output-escaping="yes"/>



  • Ron Brouwer 273 posts 768 karma points
    Nov 17, 2009 @ 15:29
    Ron Brouwer

    Thanks for helping out!

    It seems that the xml that is show above won't work for some reason.
    There is no problem when saving the template so all extensions are correct.
    However using FormatURLS or FormatTwitterDate causes the problem.
    I've replaced the FormatURLS like you suggested but it doesn't make any difference.


  • Warren Buckley 2106 posts 4799 karma points MVP ∞ admin hq c-trib
    Nov 17, 2009 @ 17:08
    Warren Buckley

    Hiya Ron,
    Is the DLL definately been copied over and along with the config file updated?

    A quick way to test is to use the built in XSLT editor.

    1. Open the xslt file in umbraco
    2. Use the insert value of button (2nd button, the one to the right of the save xslt button)
    3. Press Get Extension button
    4. From the left hand side in the dropdown CWS.Twitter should be available
    5. Then in the right hand dropdown should be FormatTwitterDate and FormatURLs

    Have you tried without fomatting the date, to see if that is the problem.


  • Ron Brouwer 273 posts 768 karma points
    Nov 18, 2009 @ 10:01
    Ron Brouwer

    Thanks Warren,

    I just found the problem.
    One of my colleagues was so good to override the xsltExtensions.config.

    I find it odd though. I never received an error from Umbraco, which it normally does whenever an extension is missing.


  • Warren Buckley 2106 posts 4799 karma points MVP ∞ admin hq c-trib
    Nov 18, 2009 @ 13:11
    Warren Buckley

    Glad you got it fixed :)

  • Ron Brouwer 273 posts 768 karma points
    Nov 18, 2009 @ 17:20
    Ron Brouwer

    Hi Warren,

    Just used your extensions only in a different xslt for a client to correctly display a twitter list of all employees working at that company.
    The xsl and xml is different but it works just fine!


  • Warren Buckley 2106 posts 4799 karma points MVP ∞ admin hq c-trib
    Nov 19, 2009 @ 09:26
    Warren Buckley

    Yeh with it being XML that the beneift of having XSLT to display what data you want back from the XML. But obviously the common one is to show your most recent tweets.


Please Sign in or register to post replies

Write your reply to: