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

Re: Version 2.0 Tips and Tricks

Subject: Re: Version 2.0 Tips and Tricks
From: "bryan rasmussen" <rasmussen.bryan@xxxxxxxxx>
Date: Fri, 4 Apr 2008 10:32:20 +0200
Re:  Version 2.0 Tips and Tricks
On Fri, Apr 4, 2008 at 10:05 AM, Pankaj Chaturvedi
<pankaj.chaturvedi@xxxxxxxxx> 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

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.