[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: InnerElement attribute needs to be set for parent
I din't know the reasons why Martin choose the code fragments below, as opposed to what I wrote. But in fact I think Martin's logic is better than mine (please see below why I think so): On 5/10/08, Martin Honnen <Martin.Honnen@xxxxxx> wrote: > <xsl:template match="propertyList"> > <xsl:copy> > <xsl:apply-templates select="property"/> > </xsl:copy> > </xsl:template> This is better, because inside the template body there is no hard coding of the 'propertyList' element. If the element name changes, it's required to change the name at only one place (at the match pattern). My logic mentioned the element name in the template body, as well. > > <xsl:template match="property"> > <xsl:attribute name="{@name}"> > <xsl:value-of select="@value"/> > </xsl:attribute> > </xsl:template> Martin's code is more aligned with the spirit of XSLT, but I thought more procedural like. But I do not dislike my logic :) -- Regards, Mukul Gandhi
|
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
|