Copied to clipboard

Flag this post as spam?

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


  • Ansar 181 posts 291 karma points
    Nov 21, 2012 @ 08:39
    Ansar
    0

    Selecting data from field with Macro param

    The following code works perfect for all the document type properties except builtin fields like @nodeName, @@createDate etc

    <xsl:variable name="propertyName" select="VALUE PASSED FROM MACRO" />

    <xsl:value-of select="$currentPage/*[name()=$propertyName]"/>

    Please help

  • Chriztian Steinmeier 2726 posts 8320 karma points MVP 4x admin c-trib
    Nov 21, 2012 @ 08:50
    Chriztian Steinmeier
    1

    Hi Anz,

    Yeah that can be alittle tricky - I think this might work:

    <xsl:variable name="isAttribute" select="starts-with($propertyName, '@')" />
    <!-- Only one of these will actually output a value  -->
    <xsl:value-of select="$currentPage/@*[name() = substring($propertyName, 2)][$isAttribute]" />
    <xsl:value-of select="$currentPage/*[name() = $propertyName][not($isAttribute)]" />

    /Chriztian

  • Ansar 181 posts 291 karma points
    Nov 21, 2012 @ 09:13
    Ansar
    0

    Thanks.. That worked like a chram :)

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies