none
xslt Hithighlighting and translate() RRS feed

  • Question

  • This is part of the XML i get from FAST Search Server:

     

      <hithighlightedproperties>
            <HHTitle />
            <HHUrl>http://site.company.com/Person.aspx?accountname=ststest\hhj</HHUrl>
            <organizationfullpath hashh="2">
    			Operations;Operational Functions;
    			<c0>
    				GHT
    			</c0>
    			;Application and Integration;
    			<c0>
    				Business Support
    			</c0>
    		</organizationfullpath>
    

    What I need to do is replace all ";" with "|" and make sure that the hithighlighting is still active, thats the stuff inside the <c0> tags.

     

    I have done updates to the original stylesheet used by the people core presentation webpart (SharePoint 2010 Ent. Search Site template). This is the template (pipem) I added:

    <xsl:template name="pipem">
        <xsl:param name="hh" />
    	<xsl:for-each select="$hh/descendant-or-self::*">
    	<xsl:choose>
    		<xsl:when test="self::text()">
    			<xsl:value-of select='translate (., ";", "|")' />
    		</xsl:when>
    		<xsl:otherwise>
    			<xsl:apply-templates select="."/>
    		</xsl:otherwise>
    		</xsl:choose>
    	</xsl:for-each>
      </xsl:template>
    


    The HTML I would like should be like this:

     

    <li id="OrganisationfullpathField">
    	Operations|Operational Functions|<b>GHT</b>|Application and Integration|<b>Business Support</b>
    </li>
    

     


    But I am not capable of creating xsl that handles it, anyone got any suggestions on how to do it, if even possible ?

    Thanks

     

     


    Wednesday, January 18, 2012 9:28 AM