Subject: Re: [xsl] Renaming an element when using copy-of From: "Jagdishwar B" <jagdishwar.beemanati@xxxxxxxxx> Date: Tue, 20 Jun 2006 21:50:17 +0200 |
Hi, pls try below xsl (modified your xsl): <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" indent="yes"/> <xsl:template match="Root"> <ArticleSet> <Article> <Journal> <PublisherName> <xsl:apply-templates select="Source/PublisherName"/> </PublisherName> <JournalTitle> <xsl:apply-templates select="Source/Publication"/> </JournalTitle> <Issn> <xsl:apply-templates select="Source/Issn"/> </Issn> <Volume> <xsl:apply-templates select="Source/Volume"/> </Volume> <Issue> <xsl:apply-templates select="Source/Issue"/> </Issue> <PubDate> <Year> <xsl:apply-templates select="Source/Date/Year"/> </Year> <Month> <xsl:apply-templates select="Source/Date/Month"/> </Month> </PubDate> </Journal> <ArticleTitle> <xsl:apply-templates select="Story/articleTitle"/>. <xsl:apply-templates select="Story/articleSubTitle"/> </ArticleTitle> <FirstPage> <xsl:apply-templates select="Source/FirstPage"/> </FirstPage> <LastPage> <xsl:apply-templates select="Source/LastPage"/> </LastPage> <!-- This is the section were I want <author> to be <Author> --> <AuthorList> <xsl:apply-templates select="Story/author"/> </AuthorList> <Abstract> <xsl:apply-templates select="Story/abstract_body"/> </Abstract> </Article> </ArticleSet> </xsl:template> <xsl:template match="Story/author"> <Author> <xsl:copy-of select="./*"/> </Author> </xsl:template> </xsl:stylesheet>
but i found your xsl file contains very less <xsl:template> elements, you included a major chunk within a single <xsl:template> element. it is recommended to define <xsl:template> element matching certain sets of elements, child elements.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Renaming an element when , Chad Chelius | Thread | [xsl] Reordering elements, Chad Chelius |
Re: [xsl] Convert XML to Excel usin, Karen Yang | Date | Re: [xsl] XML data appearing in tra, wbossons |
Month |