[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Re: _why_ do people use xsl:element and xsl:attrib
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: Re: _why_ do people use xsl:element and xsl:attribute so much Was Re: 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
|
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
|