[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: newbie question
> From: Michael Kay [mailto:mhk@xxxxxxxxx] > Sent: Saturday, March 08, 2003 6:08 AM > Subject: RE: newbie question > > > After hours of fumbling with xsl syntax this was of great > > help. Couldn't find a solution in w3c tutorial. Did I miss a > > concept that has a name? > > The name of the concept is "attribute value templates". Many > self-taught > XSLT newcomers seem to miss it; I would love to know why. I can't guess as to how often I've seen this, particularly in code from a couple years ago when we were still learning XSLT: <select name="flights"> <xsl:for-each select="flight"> <xsl:variable name="some-flight"><xsl:value-of select="@flight-number"/></xsl:variable> <option value="{$some-flight}"><xsl:value-of select="@airline"/> <xsl:value-of select="$some-flight"/></option> </xsl:for-each> </select> This illustrates the two biggest examples of sloppy code that I'm currently fixing: creating virtually every variable as an RTF, and creating needless variables in the first place. I think if newbies follow the same path I did, they learn a lot about the XSLT elements but don't get too excited about XPath beyond the basic patterns. Yet IMO that's where the true power of XSLT lies. Perhaps if so many newbies struggle with advanced XPath, that points to a weakness in some of the educational materials, at least what's online? Those who actually teach the subject likely can provide more insight. cheers, b. | brian martinez brian.martinez@xxxxxxxx | | lead gui programmer 303.708.7248 | | trip network, inc. fax 303.790.9350 | | 6436 s. racine cir. englewood, co 80111 | | http://www.cheaptickets.com/ http://www.trip.com/ | 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
|