Novell Home

Build a Full Name With This Stylesheet

Novell Cool Solutions: Tip

Digg This - Slashdot This

Posted: 30 Jul 2002
 

Some applications, (some versions of Oracle, for example) don't have a Full Name equivalent in their identity schema. And, well, some applications do. Here's a stylesheet that will help you over that hurdel by generating Full Name from Given Name and Surname.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

 <xsl:template match="add[@class-name='User']">
  <xsl:copy>
   <xsl:apply-templates select="node()|@*"/>
   <xsl:if test="add-attr[@attr-name='Given Name'] and add-attr[@attr-name='Surname']">
    <add-attr attr-name="Full Name">
     <value><xsl:value-of select="concat(add-attr[@attr-name='Given Name'],' ',add-attr[@attr-name='Surname'])"/></value>
    </add-attr>
   </xsl:if>
  </xsl:copy>
 </xsl:template>

 <xsl:template match="node()|@*">
  <xsl:copy>
   <xsl:apply-templates select="node()|@*"/>
  </xsl:copy>
 </xsl:template>

</xsl:stylesheet>


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

© 2014 Novell