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

RE: More XSL Discussion

Subject: RE: More XSL Discussion
From: Jonathan Marsh <jmarsh@xxxxxxxxxxxxx>
Date: Thu, 26 Feb 1998 09:15:11 -0800
jonathan maden case
/ Sean Mc Grath <digitome@xxxxxx> was heard to say:
[...]
| Real World Example:
[...]
| Part : Introduction
|  Chapter : The Foo Manual 
|   Section : Introduction
|    1. The Foo Manual is a work of epic proportions...in the future.
| 

/ Norman Walsh [mailto:norm@xxxxxxxxxxxxx] said on Thursday, February 26,
1998 4:40 AM
| The only wrinkle at the moment is grabbing the first and last
| ten words out of the paragraphs.  XSL needs to be able to do
| this, but I don't think we've figured out how yet.

Sure we have.  This is a classic case where escape to script makes sense.
This particular formatting operation is not in the 90%-common case (or even
99% case), and so should not result in complicating the declarative parts of
XSL.  A graceful escape to script for purposes like this should support this
kind of customized (in this case string-level) formatting.

Something like this:
<define-script>
  function myTextTrimmingFunction(string) {
    // arbitrary string manipulation goes here
    return result;
  }
</define-script>

<rule>
  <target-element type="p">

  <paragraph>
    <eval>myTextTrimmingFunction(this.text)</eval>
  </paragraph>
</rule>


 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.