|
[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: Nishi Bhonsle <nishi.bhonsle@xxxxxxxxxx>
Date: Thu, 17 Feb 2005 14:07:30 -0800
|
Jorris:
Joris Gillis wrote:
Tempore 21:38:13, die 02/17/2005 AD, hinc in
xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Nishi Bhonsle
<nishi.bhonsle@xxxxxxxxxx>:
I wrote the following, but it adds the enablePortlet element and the
sessionPool element twice in the resultant file --
<xsl:template match="portlet">
<xsl:copy>
<xsl:attribute
name="pickerCompatibleVersions"><xsl:text>10.1.2</xsl:text></xsl:attribute>
<xsl:attribute
name="maxDataRows"><xsl:text>1000</xsl:text></xsl:attribute>
<xsl:copy-of select="@*"/>
<xsl:element name="sessionPool">
<xsl:attribute
name="maxRefreshWaitMinute"><xsl:text>1</xsl:text></xsl:attribute>
<xsl:attribute
name="maxRefreshRetries"><xsl:text>1</xsl:text></xsl:attribute>
<xsl:attribute
name="maxGenericParameters"><xsl:text>10</xsl:text></xsl:attribute>
</xsl:element>
<xsl:apply-templates/>
</xsl:copy>
<xsl:copy-of select="enablePortlet"/>
</xsl:template>
Possibly, there is some other template in your xslt, whose pattern
matches the 'enablePortlet' node, that copies this node to the result
tree. So that you'll get the effect of 2 times <xsl:copy-of
select="enablePortlet"/>
What about the sessionPool node? There is no second template in there
that has the sessionPool node.
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>
Thanks.
regards,

|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
| RSS 2.0 |
|
| Atom 0.3 |
|
|