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

XSLT feature request - element value templates!

Subject: XSLT feature request - element value templates!
From: Warren Hedley <w.hedley@xxxxxxxxxxxxxx>
Date: Wed, 28 Jun 2000 10:57:07 -0400
xslt element value
I'm a big advocate of XSLT, but I must admit there are a few things in
it which really annoy me. One feature which I would like to see, and
something which I think might make a lot of people's lives easier, is
the addition of "element-value-templates", the equivalent of the current
"attribute-value-template". Consider the following XSLT fragment, which
demonstrates the problem.

  <a href="{$OUTPUT_DIRECTORY}/{base_filename}.html">
    <xsl:value-of select="$OUTPUT_DIRECTORY" />
    <xsl:text>/</xsl:text>
    <xsl:value-of select="base_filename" />
    <xsl:text>.html</xsl:text>
  </a>

The content of the href attribute and the <a> element are identical, yet
the construction of the first is beautifully simple, yet the second is
simply painful.

I must confess I haven't devoted a lot of time (< 5 minutes, to be exact)
thinking about the best way of solving this problem, but here's one fix.

  <a href="{$OUTPUT_DIRECTORY}/{base_filename}.html">
    <xsl:text template="{$OUTPUT_DIRECTORY}/{base_filename}.html" />
  </a>

Perhaps a special element is needed <xsl:element-content template="" />
to make it easier to force the content to be empty.

If this "element-value-template" functionality existed, you might never
see <xsl:value-of ... /> again!

It seems to be that this wouldn't be very hard to implement as an extension
element or attribute in existing processors - all of the relevant technology
is already there. Possibly someone has, and I haven't seen it yet.

The only question remaining is: is there demand for this?

What say the XSL-LIST.

-- 
Warren Hedley
Department of Engineering Science
Auckland University
New Zealand


 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.