xsl-list
[Top] [All Lists]

Re: [xsl] A problem with concat()

2011-04-18 13:50:44
At 2011-04-18 14:39 -0400, Bridger Dyson-Smith wrote:
I want to use concat() to pull together three elements, separating the
values with a comma.

Have you considered using the following?

   string-join( sequence, separator )

as in (note the parens):

   <xsl:value-of select="string-join( (mods:namePart[@type='family'],
                                       mods:namePart[@type='given'],
                                       mods:namePart[@type='date']), ', ' )"/>

I haven't pulled down your code (because of my time constraints), but a couple of comments of the conventions in your example that jumped out at me:

   1) select="x" is the same as select="./x"
   2) test="@type='personal'" is the same as test=".[@type='personal']"

What you typed isn't wrong, but it isn't typical. I think what I've suggested to you is more conventional syntax.

I hope this helps.  Just a couple of quick notes.

. . . . . . . . . . Ken


--
Contact us for world-wide XML consulting & instructor-led training
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
G. Ken Holman                 mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
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>