Copied to clipboard

Flag this post as spam?

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


  • Andy Felton 185 posts 484 karma points c-trib
    Feb 20, 2011 @ 17:18
    Andy Felton
    0

    XSLT confusion

    Hi,

    I've just installed and starting using Umbraco 4.6.1 and am confused why

    <xsl:variable name="longTitle" select="umbraco.library:Item($currentPage/@id,'title')"/>

    <xsl:value-of select="$longTitle"/>

    returns a valid string containing my title field but

    <xsl:value-of select="$currentPage/data [@alias = 'title']"/>

    returns a blank string. I'm sure this used to work with 4.0.2.1.

    Any help would be appreciated.

    Thanks

    Andy

  • Kim Andersen 1447 posts 2196 karma points MVP
    Feb 20, 2011 @ 17:24
    Kim Andersen
    1

    Hi Andy

    The XML schema in v4.6.1 is different from the one in 4.0.2.1. This means that you don't have to write this:

    <xsl:value-of select="$currentPage/data [@alias = 'title']"/>

    but you can just write this:

    <xsl:value-of select="$currentPage/title"/>

    /Kim A

  • Andy Felton 185 posts 484 karma points c-trib
    Feb 20, 2011 @ 17:30
    Andy Felton
    0

    Thanks for that Kim!

    All working now.

  • Kim Andersen 1447 posts 2196 karma points MVP
    Feb 20, 2011 @ 17:32
    Kim Andersen
    0

    Good to hear. Actually the XML schema changed in v.4.5 (formerly known as 4.1), but I'm glad it's working now :)

    /Kim A

  • Kim Andersen 1447 posts 2196 karma points MVP
    Feb 20, 2011 @ 18:13
    Kim Andersen
    1

    By the way Andy. If you prefer the legacy XML schema, you can find the following line in the /config/umbracoSettings.config-file:

    <UseLegacyXmlSchema>false</UseLegacyXmlSchema>

    and change it to this:

    <UseLegacyXmlSchema>true</UseLegacyXmlSchema>

    /Kim A

Please Sign in or register to post replies

Write your reply to:

Draft