Altova Mailing List Archives


Re: [xsl] InnerElement attribute needs to be set for parent

From: "Mukul Gandhi" <gandhi.mukul@--------->
To:
Date: 5/10/2008 2:12:00 PM
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

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.