Copied to clipboard

Flag this post as spam?

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


  • Dan 1288 posts 3921 karma points c-trib
    Apr 05, 2011 @ 15:53
    Dan
    0

    Prefix umbraco.contour is not defined

    Hi,

    I'm using Tim Geyssens updated poll add-on to enable the creation of polls via Contour:

    http://www.nibble.be/?p=81
    http://www.nibble.be/downloads/Contour.Addons.Poll.zip

    When I ty to save the XSLT file though I get an error:

    "System.Xml.Xsl.XslLoadException: Prefix 'umbraco.contour' is not defined. An error occurred at d:\sites\test\www.test.com\web\xslt\634376118539226000_temp.xslt(15,5).
    at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
    at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)"

    The XSLT extension is registered with an alias of 'contourpoll', which is the same as what's used in the XSLT file, but it seems to be the general XSLT extension for contour which doesn't seem to be registered.  Do I need to add this to the xsltExtensions.config file?  If so, what are the attribute values to use for this?

    Thanks!

  • Dan 1288 posts 3921 karma points c-trib
    Apr 05, 2011 @ 16:05
    Dan
    0

    Doh!  Got it.  Needed to add:

    xmlns:umbraco.contour="urn:umbraco.contour"

    ...to the xsl:stylesheet tag, and declare 'umbraco.contour' in the exclude-result-prefixes attribute of the XSLT file.

     

  • Dan 1288 posts 3921 karma points c-trib
    Apr 05, 2011 @ 16:33
    Dan
    0

    Actually, although that's supressed the error on save, the macro still errors, and it seems to be related to the use of the 'umbraco.contour' extension.  The code I have is this:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
      version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:msxml="urn:schemas-microsoft-com:xslt"
      xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:CWS.Twitter="urn:CWS.Twitter" xmlns:contourpoll="urn:contourpoll" xmlns:umbraco.contour="urn:umbraco.contour" xmlns:PS.XSLTsearch="urn:PS.XSLTsearch"
      exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets CWS.Twitter contourpoll PS.XSLTsearch umbraco.contour ">

    <xsl:output method="xml" omit-xml-declaration="yes"/>
    <xsl:param name="currentPage"/>
    <xsl:param name="formid" select="/macro/formid" />
    <xsl:template match="/">
      <xsl:value-of select="$formid"/>
      <xsl:if test="$formid">
        
    <!--
        <xsl:variable name="records" select="umbraco.contour:GetRecordsFromForm($formid)"/>
        <xsl:variable name="numberOfRecords" select="count($records/uformrecord)" />
        <div class="results" style="width:300px">
          <h3>Poll results</h3>
          <xsl:for-each select="contourpoll:PossibleAnswers($formid)//question">
            <xsl:variable name="numberOfAnswers" select="count(./answer)" />
            <h4><xsl:value-of select="caption"/></h4>
            <ul style="list-style:none;padding-left:0px;margin-left:0px;">
              <xsl:for-each select=".//answer">
                <xsl:sort select="count($records//value [@key = current()/@id])" data-type="number" order="descending"/>
                <xsl:variable name="currentId" select="@id" />
                <xsl:variable name="currentVotes" select="count($records//value [@key = $currentId])" />
                <xsl:variable name="currentPercentage" select="round (($currentVotes div $numberOfRecords) * 100)"/>
                <li>
                  <xsl:value-of select="."/>
                  <div class="scorebarcontainer" style="width:100%;background-color:#eee;height:20px">
                    <div class="scorebar" style="width:{$currentPercentage}%;background-color:#ccc;height:20px"></div>
                  </div>
                </li>
              </xsl:for-each>
            </ul>
          </xsl:for-each>
        </div>
      -->
      </xsl:if>
    </xsl:template>

    </xsl:stylesheet>

     

    The '$formid' variable outputs fine, but when I output umbraco.contour:GetRecordsFromForm($formid) it errors when I run the macro in a page.

    I notice that when I click the 'insert value-of' button in the XSLT editor then click 'get extension' there is no 'umbraco.contour' option in the first extension selector.

    I think basically I need to register the umbraco.contour extension in the config file, but (a) I'm not sure why this wouldn't be done as part of the contour installation process; (b) I thought xslt extensions actually registered automatically in 4.7 and (c) if I'm registering manually via the config file, I'm not sure what the full <ext> attribute values should be.

    Anyone?

Please Sign in or register to post replies

Write your reply to:

Draft