Subject: [xsl] Split with delimiter and remove duplicate with xsl:for-each group From: "Pankaj Chaturvedi" <pankaj.chaturvedi@xxxxxxxxx> Date: Mon, 30 Jun 2008 17:09:43 +0530 |
Hi, 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. Last week Martin has given a nice solution for splitting as below, I am not able to use it with <xsl:for-each group> Input ====== <Article> <AuthorList> <Author> <FirstName>E E</FirstName> <LastName>Bosco</LastName> <Affiliation> 1Department of Cell and Cancer Biology, University of Cincinnati, Cincinnati, OH, USA [2] 4Division of Biomedical Informatics, Cincinnati Children's Hospital Medical Center, Cincinnati, OH, USA</Affiliation> </Author> <Author> <FirstName>K</FirstName> <LastName>Stengel</LastName> <Affiliation> 1Department of Cell and Cancer Biology, University of Cincinnati, Cincinnati, OH, USA</Affiliation> </Author> <Author> <FirstName>H</FirstName> <LastName>Xu</LastName> <Affiliation> [1] 3Department of Pediatrics, University of Cincinnati, Cincinnati, OH, USA [2] 4Division of Biomedical Informatics, Cincinnati Children's Hospital Medical Center, Cincinnati, OH, USA</Affiliation> </Author> </AuthorList> </Article> Desired Output =============== <affiliationlist> <affil>1Department of Cell and Cancer Biology, University of Cincinnati, Cincinnati, OH, USA</affil> <affil>4Division of Biomedical Informatics, Cincinnati Children's Hospital Medical Center, Cincinnati, OH, USA</affil> <affil>3Department of Pediatrics, University of Cincinnati, Cincinnati, OH, USA</affil> </affiliationlist> What I've tried till, which I understand is terribly incorrect, might be in selection of current-grouping-key(), though trying from few hours (Never tried xsl:for-each-group before): Stylesheet ========== <affiliationlist> <xsl:call-template name="affiliation"/> </affiliationlist> <xsl:template name="affiliation"> <xsl:for-each-group select=".//Affiliation" group-by="./Author/Affiliation"> <xsl:value-of select="current-grouping-key()"/> <xsl:for-each select="tokenize(., '\[\d+\]')[normalize-space(.)]"> <affil> <xsl:value-of select="normalize-space(current-grouping-key())"/> </affil> </xsl:for-each> </xsl:for-each-group> </xsl:template> Can somebody guide me in this regard. Best, Pankaj Chaturvedi ============================================================================ ================ Confidentiality Notice:" This message and any attachment(s) contained here are information that is confidential, proprietary to IDS Infotech Ltd. and its customers. Contents may be privileged or otherwise protected by law. The information is solely intended for the individual or the entity it is addressed to. If you are not the intended recipient of this message, you are not authorized to read, forward, print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error, please notify the sender immediately by return e-mail and delete it from your computer."
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Re: OOXML, Dimitre Novatchev | Thread | Re: [xsl] Split with delimiter and , Deborah Pickett |
Re: [xsl] Re: OOXML, Deborah Pickett | Date | Re: [xsl] Split with delimiter and , Deborah Pickett |
Month |