Copied to clipboard

Flag this post as spam?

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


  • Daniel 4 posts 24 karma points
    May 11, 2012 @ 12:30
    Daniel
    0

    GetPreValueAsString wont work for me.

    I can return the numeric value of the dropdown 'articleType'.  I cant seem to get the text value using GetPreValueAsString. Thows an error when I add the line in italic containing the function. Tried ignoring errors but it wont parse.

    <tr>

      <td class="content-kb-title"><href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName"/></a></td>
      <td class="content-kb-doctype">
        <xsl:if test="./articleType &gt; 0">
          <xsl:value-of select="./articleType"/>
          <xsl:value-of select="umbraco.library:GetPreValueAsString(./articleType)"/>
        </xsl:if>
        </td>
      <td class="content-kb-lastdate"><xsl:value-of select="umbraco.library:FormatDateTime(@updateDate, 'd')"/>
    </td>
      </tr>

     

    Error occured

    System.Xml.Xsl.XslTransformException: Extension functions cannot return null values. 
    at System.Xml.Xsl.Runtime.XmlQueryRuntime.ChangeTypeXsltResult(XmlQueryType xmlType, Object value) 
    at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args) 
    at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) 
    at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) 
    at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) 
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results) 
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer) 
    at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver) 
    at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results) 
    at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)

     

     

  • Daniel 4 posts 24 karma points
    May 11, 2012 @ 12:35
    Daniel
    0

    The italics dissapeared. the line that throws the error is:

     <xsl:value-of select="umbraco.library:GetPreValueAsString(./articleType)"/>

    I can type in random numbers and sometimes get a result.

    Cheers.

     

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    May 11, 2012 @ 12:37
    Chriztian Steinmeier
    0

    Hi Daniel,

    It sounds like the prevalue could have been deleted - could that be the case?

    Your code probably runs on a number of nodes - if one of them has a deleted prevalue stored, it will most likely fail.

    /Chriztian

  • Daniel 4 posts 24 karma points
    May 11, 2012 @ 12:51
    Daniel
    0

    Hi Chriztian,

    thanks for the reply. How do I fix that?

    Dan

  • Daniel 4 posts 24 karma points
    May 11, 2012 @ 14:30
    Daniel
    0

    My bad.

    It was an Ultimate picker and the value was a node id. :-(

Please Sign in or register to post replies

Write your reply to:

Draft