BrentN

I've got a keywords column which is a look-up to a list. This column is used in an internal technical knowledge base. Multiple selections are allowed.

On display forms the field is rendered as a semicolon delim list, as expected. I'd rather see those displayed one per line. Is there a way to do this with XSL I did find a blog post about using regular expressions and building a class that would do this task, but I don't have VS2005 available to me, nor am I developer. I do have SPD2007.

Thanks,

Brent



Re: SharePoint - Development and Programming Display multivalue field as a list, rather than semicolon delim.

Curtis Ruppe

Look into the ControlTemplates directory (C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATES), and you should be able to find the ascx file that renders your content.



Re: SharePoint - Development and Programming Display multivalue field as a list, rather than semicolon delim.

BrentN

That won't help in this instance - I'm using a custom dataview which renders with XSL. I need some kind of fancy XSL in order to do this. Sad but thanks for the reply!



Re: SharePoint - Development and Programming Display multivalue field as a list, rather than semicolon delim.

Curtis Ruppe (MicroStaff IT)

You might be able to do something similar to this:

Code Snippet

<xsl:call-template name="stringreplace">

<xsl:with-param name="stringvalue" select="@CalculatedColumn"></xsl:with-param>
<xsl:with-param name="from" >;#</xsl:with-param>
<xsl:with-param name="to"><br/></xsl:with-param>
</xsl:call-template>

PS: You may need to replace my "<br/>" with "&lt;br/&gt;" or maybe even "&amp;lt;br/&amp;gr;"




Re: SharePoint - Development and Programming Display multivalue field as a list, rather than semicolon delim.

Brian Abram

You can replace the semicolon-delimited list with breaks by doing the following:

First, you'll need to find where the given element is being processed in the XSL. If your property name were @Element, then replace

Code Snippet
<xsl:value-of select="@Element" />

with

Code Snippet
<xsl:call-template name="printLookupSequence">
<xsl:with-param name="sequence" select="concat(@Element, ';')" />
</xsl:call-template>

Finally, add the following XSL template

Code Snippet

<xsl:template name="printLookupSequence">
<xsl:param name="sequence"/>
<xsl:if test="string-length($sequence) > 0">
<xsl:value-of select="substring-before($sequence, ';')" />
<br />
<xsl:call-template name="printLookupSequence">
<xsl:with-param name="sequence" select="substring-after($sequence, ';')" />
</xsl:call-template>
</xsl:if>
</xsl:template>





Re: SharePoint - Development and Programming Display multivalue field as a list, rather than semicolon delim.

BrentN

Worked like a charm - Thank you VERY much!