Copied to clipboard

Flag this post as spam?

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


  • manuelpedrera 18 posts 38 karma points
    Oct 28, 2010 @ 18:42
    manuelpedrera
    0

    Writting attributes in XML

    Hi all, I have a very newbie cuestion:

    I can write into the value of a node by using this syntax:

    <node><xsl:value-of select="@nodeName"/></node>

    But what if I want to write an attribute? For example:

    <node attribute="VALUE OF THE ATTRIBUTE">nodeContent</node>

    Thanks in advance

  • Rich Green 2246 posts 4006 karma points
    Oct 28, 2010 @ 18:49
    Rich Green
    0

    Untested, but this might work

    <node><xsl:attribute name="attribute"><xsl:value-of select="@nodeName"/></xsl:attribute></node>

    Rich

  • Chriztian Steinmeier 2726 posts 8320 karma points MVP 4x admin c-trib
    Oct 28, 2010 @ 19:16
    Chriztian Steinmeier
    1

    Hi Manuel,

    There's a nice little shortcut called an "Attribute Value Template":

    <node attribute="{@nodeName}"></node>

    /Chriztian

  • manuelpedrera 18 posts 38 karma points
    Oct 29, 2010 @ 12:06
    manuelpedrera
    0

    Thank you!

    I will use the one with the shortcut

  • 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