Subject: Re: [xsl] Inverting names with Jr and Sr considered From: "Imsieke, Gerrit, le-tex" <gerrit.imsieke@xxxxxxxxx> Date: Tue, 06 Nov 2012 01:21:53 +0100 |
<xsl:analyze-string select="." regex="\s+([JS]r)\s*$"> <xsl:matching-substring> <xsl:text> (</xsl:text> <xsl:value-of select="regex-group(1)"/> <xsl:text>)</xsl:text> </xsl:matching-substring> <xsl:non-matching-substring> <xsl:analyze-string select="." regex="(.+?)\s+(\w+)\s*$"> <xsl:matching-substring> <xsl:value-of select="regex-group(2)"/> <xsl:text>, </xsl:text> <xsl:value-of select="regex-group(1)"/> </xsl:matching-substring> </xsl:analyze-string> </xsl:non-matching-substring> </xsl:analyze-string>
This must have been done many times, so can some one show me where to find the answer?
I have a series of personal names in natural order that I need to invert. The surname is always last except when followed by bJrb, or bSrb (either of which may not be present). I want to represent:
J Allen Rogers b> Rogers, J Allen Bill T Wilson Jr b> Wilson, Bill T (Jr) A B Brown b> Brown, A B John Victor Case Sr b> Case, John Victor (Sr)
and so on. There may be a single space or multiple spaces between some the elements of the name.
It looks like <xsl:analyze-string> will do this, but I do not know how to write regex.
Thanks, Mark
-- Gerrit Imsieke GeschC$ftsfC<hrer / Managing Director le-tex publishing services GmbH Weissenfelser Str. 84, 04229 Leipzig, Germany Phone +49 341 355356 110, Fax +49 341 355356 510 gerrit.imsieke@xxxxxxxxx, http://www.le-tex.de
Registergericht / Commercial Register: Amtsgericht Leipzig Registernummer / Registration Number: HRB 24930
GeschC$ftsfC<hrer: Gerrit Imsieke, Svea Jelonek, Thomas Schmidt, Dr. Reinhard VC6ckler
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Inverting names with Jr and S, Mark | Thread | Re: [xsl] Inverting names with Jr a, Mark |
[xsl] Inverting names with Jr and S, Mark | Date | Re: [xsl] Inverting names with Jr a, Mark |
Month |