[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xslt adds elements twice in xml.

Subject: Re: xslt adds elements twice in xml.
From: Jon Gorman <jonathan.gorman@xxxxxxxxx>
Date: Thu, 17 Feb 2005 17:33:21 -0600
jon gorman
> I looked, but I could not find any other template with the enablePortlet
> node, i found the following which I do not think should matter --
> <xsl:template match="*">
> <xsl:copy>
> <xsl:copy-of select="@*"/>
> <xsl:apply-templates/>
> </xsl:copy>
> </xsl:template>
> 

This actually makes quite a difference.

In your initial template you had an <xsl:apply template/> with the
<xsl:copy>.  This will apply any matching templates to the children
nodes.  Since the template you just gave will match any element, and
elementPool is a child element of portlet, it has this template
applied to it.  And this template copies the current element and then
apply-templates to the children.  (I don't know if the description I
gave follows the XLST terminology exactly, but it's close enough for
our purpose here).

You might wish to add templates that say <xsl:template
match="enablePortlet"/> and <xsl:template match="sessionPortlet"/> but
I would recommend rewriting it so you pull the templates out of the
initial one similar to my previous email.


Jon Gorman

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.