Re: [xsl] A problem with concat()

Subject: Re: [xsl] A problem with concat()
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 18 Apr 2011 14:50:28 -0400
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@xxxxxxxxxxxxxxxxxxxx Legal business disclaimers: http://www.CraneSoftwrights.com/legal

Current Thread