Subject: Re: [xsl] Split with delimiter and remove duplicate with xsl:for-each group From: Deborah Pickett <debbiep-list-xsl@xxxxxxxxxx> Date: Mon, 30 Jun 2008 22:48:34 +1000 |
I am trying to use the combination of <xsl:for-each-group> to avoid duplicate and split data of <Affiliation> , using [number] as the delimiter.
<xsl:template match="/Article"> <xsl:variable name="affiliations" as="xs:string+"> <xsl:for-each select="//Affiliation"> <xsl:analyze-string select="string(.)" regex="\[\d+\]([^\[]*)"> <xsl:matching-substring> <xsl:sequence select="normalize-space(regex-group(1))"/> </xsl:matching-substring> <xsl:non-matching-substring> <xsl:if test="normalize-space(.)"> <xsl:sequence select="normalize-space(.)"/> </xsl:if> </xsl:non-matching-substring> </xsl:analyze-string> </xsl:for-each> </xsl:variable>
<affiliationlist> <xsl:for-each select="distinct-values($affiliations)"> <affil><xsl:value-of select="."/></affil> </xsl:for-each> </affiliationlist> </xsl:template> </xsl:stylesheet>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Split with delimiter and remo, Pankaj Chaturvedi | Thread | Re: [xsl] Split with delimiter and , Martin Honnen |
[xsl] Split with delimiter and remo, Pankaj Chaturvedi | Date | Re: [xsl] Split with delimiter and , Martin Honnen |
Month |