Re: [xsl] Re: xsl-list Digest 1 Jun 2006 05:10:01 -0000 Issue 793

Subject: Re: [xsl] Re: xsl-list Digest 1 Jun 2006 05:10:01 -0000 Issue 793
From: Chad Chelius <cchelius@xxxxxxxxxxxxxxx>
Date: Thu, 1 Jun 2006 13:40:40 -0400
David,
Below is the XSLT that I am currently trying to use. The portion above the first comment creates the structure that I want except that it doesn't include the <Root> element that the <Story> element is contained in. Then when I add the instructions below the first comment to try to rename the elements, I lose the structure and tags that I want. My XML file structure is as such:


<Root>
	<Story>
		<articleTitle>Content</articleTitle>
		<articleSubTitle>Content</articleSubTitle>
		<author><authorFname>content</authorFname></author>

This is my stylesheet:

<xsl:template match="Story">
<xsl:copy>
<BB><TG>
<xsl:apply-templates select="articleTitle|articleSubTitle"/>
</TG></BB>
<xsl:apply-templates select="*[not(self::articleTitle or self::articleSubTitle)]"/>
</xsl:copy>
</xsl:template>
<!--Above this line creates the directory structure that I need-->
<xsl:template match="Root">
<DG>
<xsl:apply-templates select="@*|node()"/>
</DG>
</xsl:template>
<xsl:template match="Story">
<D>
<xsl:apply-templates select="@*|node()"/>
</D>
</xsl:template>


<chad/>

Chad Chelius
AGI Training
cchelius@xxxxxxxxxxxxxxx


On Jun 1, 2006, at 12:05 PM, David Carlisle wrote:


I need all of the other elements to come over as
well and I need to rename those elements.
yes that's what the
 <xsl:apply-templates select="*[not(self::title or self::subtitle)]"/>
is doing, applying your templates to all the child elements.
Sounds like you don't want document to go to document though so change
 <xsl:copy>  to <D>

and when I said

you just need a standard identity template,
read that as "you just need the templates doing whatever transformation
they are doing"


David

Current Thread