Copied to clipboard

Flag this post as spam?

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


  • Kate 267 posts 610 karma points
    Sep 28, 2010 @ 21:33
    Kate
    0

    No output on my website

    Hi

    I'm trying to get my data displayed on the website, but it will not succeed, please help.

    My xslt looks like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
      version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:msxml="urn:schemas-microsoft-com:xslt"
      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="/">
     <xsl:variable name="advertNode" select="$currentPage/ancestor-or-self::* [@isDoc][string(advertTextc)!=''] [position()=1] " />
     

    <xsl:value-of select="$advertNode/advertText" />
    <xsl:value-of select="$advertNode/advertImage" />

     <a>
       <xsl:attribute name="href">
           <xsl:value-of select="$advertNode/advertLink" />
       </xsl:attribute>
       Læs mere
     </a>

     
    <!-- start writing XSLT -->

    </xsl:template>

    </xsl:stylesheet>


    And in my template:

    <umbraco:Macro Alias="Editor" runat="server"></umbraco:Macro>


    And my document type look like this:



    What am I doing wrong?

  • Kim Andersen 1447 posts 2196 karma points MVP
    Sep 28, 2010 @ 22:05
    Kim Andersen
    0

    Hi Kate.

    The node you want to grab the values from, does it have a property called advertTextc? And if so, does this property have a value?

    Otherwise, it's always a good idea to see what you have to work with, by printing out variables like this:

    <textarea>
    <xsl:copy-of select="$advertNode"/>
    </textarea>

    This way you can check to see if you have any nodes in the variable.

    /Kim A

  • Kate 267 posts 610 karma points
    Sep 29, 2010 @ 08:59
    Kate
    0

    As you predicted, I got no output
    Can you explained what you mean by "The node you want to grab the values from, does it have a property called advertTextc?"

    Do you know any good articles that describes xslt to umbraco 4.5 ?
    Can you help me understand the xslt?

    Let me explain what I want on my Site.
    At my home I have an advertisement with some text, picture and a link. This advertising box goes back on all sides.
    I want the user to change the data in that box on the sides. If they choose not to change contents, Umbraco just select the text that appears in the top of the hierarchy.

Please Sign in or register to post replies

Write your reply to:

Draft