[Home] [By Thread] [By Date] [Recent Entries]
Pankaj Chaturvedi schrieb:
Hi all, [...] Manipulating data, adding issue is not seems to be problem to me and I can very much do that, while checking the <journalcode> string with the use of XSLT, but I am little bit stuck with Idea how to do it in best way.
I don't know if this is the best approach. Its viability may depend on how much reshaping is required for your different journal codes. Michael <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="article[ .//journalcode = 'CEDE' ]"> <xsl:comment>CEDE</xsl:comment> <xsl:copy> <xsl:apply-templates mode="CEDE"/> </xsl:copy> </xsl:template> <xsl:template match="article[ .//journalcode = 'EHEF' ]"> <xsl:comment>EHEF</xsl:comment> <xsl:copy> <xsl:apply-templates mode="EHEF"/> </xsl:copy> </xsl:template> <!-- join authorfield, year, chaptitle, booktitle --> <xsl:template match="ref-book" mode="CEDE"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:apply-templates select="authorfield"/> <xsl:text>, </xsl:text> <xsl:apply-templates select=".//year"/> <xsl:text>. </xsl:text> <xsl:apply-templates select="chaptitle"/> <xsl:text>, In: </xsl:text> <xsl:apply-templates select="booktitle"/> <xsl:apply-templates mode="CEDE"/> </xsl:copy> </xsl:template> <!-- omit these --> <xsl:template match="authorfield | year | chaptitle | booktitle" mode="CEDE"/> <!-- do special stuff for EHEF --> <!-- ... --> <!-- Maybe sufficient for all journal codes? --> <xsl:template match="author-ref"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:apply-templates select="givenname"/> <xsl:apply-templates select="surname"/> </xsl:copy> </xsl:template> <!-- an identity template for each mode --> <xsl:template match="@*|node()" mode="EHEF"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="EHEF"/> </xsl:copy> </xsl:template> <xsl:template match="@*|node()" mode="CEDE"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="CEDE"/> </xsl:copy> </xsl:template> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> </xsl:stylesheet>
|

Cart



