Copied to clipboard

Flag this post as spam?

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


  • Toni Becker 146 posts 425 karma points
    Jun 19, 2011 @ 09:20
    Toni Becker
    0

    Retrive Specific Value From XML

    I'm working on a project and i need this PD Calendar. My own Razor Calendar is not ready to use yet. So i have to use this one. Problem here i'm not very skilled at XSLT because i'm programming with MVC3, EF, Razor.

    Here's my XML:

    <eventArea id="1103" parentID="1048" level="2" writerID="0" creatorID="0" nodeType="1100" template="1102" sortOrder="6" createDate="2011-06-14T14:44:07" updateDate="2011-06-19T08:44:17" nodeName="Eventarea" urlName="eventarea" writerName="admin" creatorName="admin" path="-1,1048,1103" isDoc="">
    <EventItem id="1104" parentID="1103" level="3" writerID="0" creatorID="0" nodeType="1101" template="1113" sortOrder="1" createDate="2011-06-14T14:44:20" updateDate="2011-06-19T08:44:17" nodeName="1st event" urlName="first-eventn" writerName="admin" creatorName="admin" path="-1,1048,1103,1104" isDoc="">
    <event>
              <pdcalendarevent>
                <pdcstart>2011-06-14</pdcstart>
                <pdcstartt>634436064000000000</pdcstartt>
                <pdcend />
                <pdcendt />
                <pdcrec>0</pdcrec>
              </pdcalendarevent>
            </event>
            <categoryClass><![CDATA[Aero]]></kategorieKlasse>
          </EventItem>
    </eventArea>

    So problem is that i need the value form <categoryClass> to render inside my XSLT to switch the colors.

    Here comes the xslt:

    <xsl:template name="createOneCell"><xsl:param name="cell"/>
        <td><xsl:value-of select="date:dayinmonth($cell/@date)"/>  
         <xsl:for-each select="$cell/event">
           <a class="here i have to input the value from categoryClass" href="{umbraco.library:NiceUrl(@id)}">
           <xsl:value-of select="umbraco.library:GetXmlNodeById(@id)/@nodeName"/>
           </a>
           </xsl:for-each>
        </td>
    </xsl:template>

    If somebody can help, would be awesome.
    Greetings Toni

     

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Jun 19, 2011 @ 09:27
    Peter Dijksterhuis
    0

    Hi Toni,

    the xslt is part of the xslt that came with pdcalendar right?

    You could try this:

    <a class="{umbraco.library:GetXmlNodeById(@id)/categoryClass}">

    Peter

  • Toni Becker 146 posts 425 karma points
    Jun 19, 2011 @ 09:30
    Toni Becker
    0

    Yep true it's part from PD Calendar :) will test out your snippet.

  • Toni Becker 146 posts 425 karma points
    Jun 19, 2011 @ 09:32
    Toni Becker
    0

    Thanks dude that did the trick. Now finish the client side and than i'm finishing my mvc3 razor driven calendar.

    Thanks a lot :)

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Jun 19, 2011 @ 09:48
    Peter Dijksterhuis
    0

    No problem :)

    Dont forget to mark the answer as solution so for others it is more easy to find as well.

  • Tito 314 posts 623 karma points
    Jan 24, 2012 @ 12:47
    Tito
    0

    Hi Toni, is your razor driven calendar finished? Could you publish it as a package?

    Im interested in razor templating pd calendar as i dont know about xslt.

    Thanks

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jan 24, 2012 @ 13:23
  • Tito 314 posts 623 karma points
    Jan 24, 2012 @ 14:14
    Tito
    0

    Thanks Jeroen,

    PD Calendar is what im trying, but the templates are on xslt and i need razor. I dont know how to query PD Calendar properties on razor. I dont know XSLT.

    UCalendar seems to be expesive, i would like a free package. Does UCalendar have a free edition?

    Thanks

     

Please Sign in or register to post replies

Write your reply to:

Draft