xsl-list
[Top] [All Lists]

Re: [xsl] Inserting commas between a list of distinct values and a period (full stop) after the last task

2012-04-18 18:42:21
At 2012-04-18 16:37 -0700, Mark wrote:
I collect from an XML document a list of the distinct tasks performed during multiple sessions with:
<fo:block>
     <xsl:text>Projects Tasked: </xsl:text>
     <xsl:value-of select="distinct-values(//Session/@task)"/>
</fo:block>
This produces a correct list of all the distinct tasks from multiple occurrences of the same tasks:
LS Authorities Maintenance Administration Meeting

Which I want to put in the PDF document punctuated as:
LS Authorities, Maintenance, Administration, Meeting.
where ("LS Authorities" is recorded as a single task despite its internal space).

Can this be done with the information given?

<xsl:value-of select="distinct-values(//Session/@task)"
              separator=", "/>
<xsl:text>.</xsl:text>

I hope this helps.

. . . . . . Ken

--
Public XSLT, XSL-FO, UBL and code list classes in Europe -- May 2012
Contact us for world-wide XML consulting and instructor-led training
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/
G. Ken Holman                   mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Google+ profile: https://plus.google.com/116832879756988317389/about
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>