[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: newbie question

Subject: RE: newbie question
From: "Martinez, Brian" <brian.martinez@xxxxxxxx>
Date: Sat, 8 Mar 2003 12:00:52 -0700
sarissa cdata
> 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"/>&#160;<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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.