Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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"><a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName"/></a></td> <td class="content-kb-doctype"> <xsl:if test="./articleType > 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)
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.
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
Hi Chriztian,
thanks for the reply. How do I fix that?
Dan
My bad.
It was an Ultimate picker and the value was a node id. :-(
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
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"><a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName"/></a></td>
<td class="content-kb-doctype">
<xsl:if test="./articleType > 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)
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.
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
Hi Chriztian,
thanks for the reply. How do I fix that?
Dan
My bad.
It was an Ultimate picker and the value was a node id. :-(
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.