Novell is now a part of Micro Focus

Copying Values From One Attribute to Another

Novell Cool Solutions: Tip

Digg This - Slashdot This

Posted: 25 Jun 2002

Here's how to take all the values in Group Membership and copy them to Security Equals. The following stylesheet accomplishes this task using the <xsl:copy-of> (not <xsl:copy>) to insert a result tree fragment into the result tree.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="">
  <xsl:strip-space elements="*"/>
  <xsl:preserve-space elements="association add-association remove-association value component password check-password"/>
  <xsl:output indent="yes" method="xml"/>

  <!-- identity transform for everything we don't want to mess with -->
  <xsl:template match="node()|@*">
    <xsl:apply-templates select="@*|node()"/>

  <xsl:template match="add-attr[@attr-name='Group Membership']">
    <xsl:apply-templates select="@*|node()"/>
    <add-attr attr-name="Security Equals">
    <xsl:copy-of select="./value"/>

Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions.

© Micro Focus