xsl-list
[Top] [All Lists]

Re: [xsl] Version 2.0 Tips and Tricks

2008-04-04 01:32:48
On Fri, Apr 4, 2008 at 10:05 AM, Pankaj Chaturvedi
<pankaj(_dot_)chaturvedi(_at_)idsil(_dot_)com> wrote:

 why are you copying an attribute and then attempting to apply
 templates on attributes or nodes below it?


 Don't it means template copies input to output.


sure this:

<xsl:template match="@*">
  <xsl:copy/>
 </xsl:template>

is matching and copying an attribute

this is

<xsl:template match="@*">
        <xsl:apply-templates select="@*"/>
 </xsl:template>

matching an attribute and then applying templates on attributes  that
are children of that attribute, which is probably not gonna be too
successful.

thus this

<xsl:template match="@*|node()">
  <xsl:copy>
       <xsl:apply-templates select="@*|node()"/>
  </xsl:copy>
 </xsl:template>

is matching attributes and nodes
copying the matched, applying templates on any child attributes or
nodes of the matched attribute or node. This shouldn't be causing your
trouble, since it is allowed, it just always struck me as wasteful
when I see it.

Actually I can't see anything specifically in your code that is
causing the problem you mention.


Cheers,
Bryan Rasmussen

--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>