Copied to clipboard

Flag this post as spam?

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


  • Magnus Szatkowski 28 posts 149 karma points
    Aug 12, 2016 @ 08:12
    Magnus Szatkowski
    0

    Hey Guys,

    Sorry for bothering you. I have a problem with XLST. I have everything fixed except the usage of functions in XSLT.

    I have this code, which transforms an XML feed into a table of information. It uses dates as the main part. However, i cant seem to get name of date right.

    I have this template which i would like to include:

    <xsl:template name="formatDay">
    <xsl:param name="dateTime" />
    <xsl:variable name="formattedDateTime" select="substring-before($dateTime, 'T')" />
    <xsl:value-of select="functx:day-of-week-name-en(xs:date('$formattedDateTime'))" /></xsl:template>
    

    However, i can't figure out how to include this:

    <xsl:function name="functx:day-of-week-name-en" as="xs:string?" xmlns:functx="http://www.functx.com">
        <xsl:param name="formattedDateTime" as="xs:anyAtomicType?"/>
        <xsl:sequence select="('Sondag', 'Mandag', 'Tirsdag', 'Onsdag','Torsdag', 'Fredag', 'Lordag')[functx:day-of-week($date) + 1]"/></xsl:function>
    

    Could anyone help me?

    Kind regards, Magnus

  • Magnus Szatkowski 28 posts 149 karma points
    Aug 15, 2016 @ 11:02
    Magnus Szatkowski
    0

    Bump

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 7x admin c-trib
    Aug 15, 2016 @ 11:53
    Chriztian Steinmeier
    0

    Hi Magnus,

    The code you're trying to include is XSLT 2.0 code which isn't supported by .NET (and thus not usable in Umbraco).

    You should, however, be able to use the FormatDateTime() function to get the day name - something like this:

    <xsl:value-of select="umbraco.library:FormatDateTime($formattedDateTime, 'dddd')" />
    

    IIRC, it will use the current locale so you'll get localized day-names if you're working in a multisite solution.

    Hope that helps,

    /Chriztian

  • Joshua 6 posts 76 karma points
    Nov 09, 2016 @ 08:41
    Joshua
    0

    Hi Chriztian,

    I want my company logo to print in first and second pages on left top in header.

    I used the below code and made the company logo to print in first page and rest of the pages.

    But I want my logo to print only in first and second pages and not in rest of the pages

    enter image description here

    enter image description here

    enter image description here

    Could you please help me out.

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 7x admin c-trib
    Nov 09, 2016 @ 08:48
    Chriztian Steinmeier
    1

    Hi Joshua,

    Could you post a new separate forum post for this? It's much better than posting additional questions in posts that have already been solved (or relates to a different problem).

    Also: You should post a little more details - e.g., I'm not even sure how I can get the "page number" you're referring to (are they the first and second children of $currentPage in a standard macro, or how are you executing the XSL-FO ?)

    /Chriztian

  • Joshua 6 posts 76 karma points
    Nov 09, 2016 @ 09:46
    Joshua
    0

    Hi Chriztian,

    Its already been posted in Forum Topic 'Xslt' But I haven't got any perfect replies.

    I have explained in it.

    Could you please have a look in it.,So I can explain you with more clarity.

Please Sign in or register to post replies

Write your reply to:

Draft