Copied to clipboard

Flag this post as spam?

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

  • Jameskn 64 posts 78 karma points
    Aug 16, 2010 @ 22:54

    4.5.1 And NiceUrl

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
      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" 
      exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">

    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

    <!-- start writing XSLT -->
    <xsl:for-each select="$currentPage/*">
      <xsl:if test="string(@id) != '' ">

         <!-- do this -->
        <li><href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName"/></a></li>



    So I am just a touch stuck.. really am scratching my head . This will produce a nice list but the NiceUrl part just returns a blank . I have checked @id it returns the id as you would expect .. I have to say I am stuck. I assume my umbraco build is corrupted or something. 

    I am so hoping someone can view above and just say.. Nope you are being dumb it is xx . ;) 

    I am using  <UseLegacyXmlSchema>true</UseLegacyXmlSchema> in the umbraco config file. 

    umbraco v 4.5.1 (Assembly version: 1.0.3858.40498

    Any help would be great. 

    Many thanks, 



  • Sascha Wolter 615 posts 1101 karma points
    Aug 17, 2010 @ 00:51
    Sascha Wolter

    Hi James,

    maybe it's worth checking the /App_Data/umbraco.config file if the legacy Xml Schema is generated alright.

    Otherwise the above looks okay to me, you could maybe try the following although I don't expect anything fancy coming from it:

    count: <xsl:value-of select="count($currentPage/descendant::node)" /><br />
    <xsl:for-each select="$currentPage/descendant::node">
        <textarea style="width: 200px; height: 200px;">
          <xsl:copy-of select="current()" />
        </textarea><br />
        id: <xsl:value-of select="current()/@id" /><br />
        name: <xsl:value-of select="current()/@nodeName" /><br />
        <a href="{current()/@id}"><xsl:value-of select="current()/@nodeName" />


  • Jameskn 64 posts 78 karma points
    Aug 17, 2010 @ 01:19

    Hi Sascha, 

    Thanks so much for reply.. well I am pretty sure it is now a site issue. /cry basically you prompted me to try to re-publish the site. It has duplicated all of the nodes .. and I tried again re-publish I now have 3 times as many nodes. Methinks .. I might have a problem. The site has 800 pages so and I have just upgraded it locally on my laptop to test it.. At the moment though it looks like 4.5.1 is not going to love me or this site. I will have to look at why the umbraco manager has only one copy of the page but the publish page looks to be able to find 3 times as many pages and no url. Either way this upgrade is a bit of drama to say the least .. Thankfully not in a live environment. 

    If I found my issue I will post it as I doubt I will be the last person with this problem. 


Please Sign in or register to post replies

Write your reply to: