xsl-list
[Top] [All Lists]

Re: xslt adds elements twice in xml.

2005-02-17 16:33:21
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--