Copied to clipboard

Flag this post as spam?

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


  • aradhya 11 posts 30 karma points
    Feb 28, 2010 @ 17:54
    aradhya
    0

    Error with NiceUrl

    Hi,

     

    I am getting an error when try to save a xslt file,  Please help me, where am I going wrong?

    my code is

     

    <xsl:variable name="sampleLink1" select="$currentPage/data[@alias='sampleLink1']" />
    <a href="{umbraco.library:NiceUrl($sampleLink1)}"><xsl:value-of select="$currentPage/data[@alias = 'registerHeading']"/></a>

    <xsl:variable name="sampleLink2" select="$currentPage/data[@alias='sampleLink2']" />
    <a href="{umbraco.library:NiceUrl($sampleLink2)}"><xsl:value-of select="$currentPage/data[@alias = 'registerHeading']"/></a>

    ---------------------------------------------------------------------------------------

    (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter)
    at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results)
    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)

    -------------------------------------------------------------------------------------------

    My folder structure is

     

    Homepage  (sampleLink1 & SampleLink2 contentpicker are defned)

           SampleLinkPage1

           SampleLinkPage2

     

     

    Thanks,

    Aradhya

  • Ron Brouwer 273 posts 768 karma points
    Feb 28, 2010 @ 19:38
    Ron Brouwer
    4

    Hi,

    Try using an xsl:if

    <xsl:variable name="sampleLink1" select="$currentPage/data[@alias='sampleLink1']" />
    <xsl:if test="$sampleLink1 != ''">
    <a href="{umbraco.library:NiceUrl($sampleLink1)}">
    <xsl:value-of select="$currentPage/data[@alias = 'registerHeading']"/>
    </a>
    </xsl:if>

    Ron

Please Sign in or register to post replies

Write your reply to:

Draft