Re: [xsl] Re: _why_ do people use xsl:element and xsl:attribute so much Was Re:[xsl] xslt svg problem

Subject: Re: [xsl] Re: _why_ do people use xsl:element and xsl:attribute so much Was Re:[xsl] xslt svg problem
From: "Eileen Kinley" <kinley@xxxxxxxxx>
Date: Tue, 4 Sep 2001 11:11:29 -0400
When I started learning XSL, I thought mostly in terms of "push" scenarios -
when I encounter this node, then create "that" in the result tree.  Using
xsl:element and xsl:attribute reinforced the idea of tree building for me.
Also, I was working mostly in that other dialect, so...

Eileen

----- Original Message -----
From: "David Carlisle" <davidc@xxxxxxxxx>
To: <gary.frederick@xxxxxxxxx>
Cc: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, September 04, 2001 10:55 AM
Subject: [xsl] Re: _why_ do people use xsl:element and xsl:attribute so much
Was Re:[xsl] xslt svg problem


>
> > I found them easier to understand when I was starting to climb the
> > learning curve.
>
> It seems like you are not alone, which is really why I asked the
> question, because I don't understand why that is so. Which sometimes
> makes it hard to give helpful, as opposed to my usual terse & grumpy:-),
> comments....
>
> It seems to me that the whole ethos of xslt is that you have a
> "template" that is more or less a copy of what you are trying to
> produce, into which you scatter the odd instruction from the xslt/xpath
> where required. thus to generate an "a" element with an
> attribute href you just do that:
>
> <a href="
> but at this point drop into Xpath (inside {})
>  {@xlink:href}"
> and then finish off the element start tag
> >
>
> This just seems so much simpler than
>
> <xsl:element name="a">
>  <xsl:attribute name="href">
>    <xsl:value-of select="@xlink:href"/>
>  </xsl:attribute>
>
> That I would say that xsl:element and xsl:attribute only be used (or
> shown to) advanced users who are needing to generate the
> element/attribute names based on the run time behaviour of the
> stylesheet rather than the far more usual case of generating fixed names
> from the stylesheet or source.
>
> David
>
> _____________________________________________________________________
> This message has been checked for all known viruses by Star Internet
> delivered through the MessageLabs Virus Scanning Service. For further
> information visit http://www.star.net.uk/stats.asp or alternatively call
> Star Internet for details on the Virus Scanning Service.
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread