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

Re: variable matching...

Subject: Re: variable matching...
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 8 Dec 2003 13:15:14 GMT
Re:  variable matching...


  I'm not sure I understand this.  So make a short stylesheet
  which moves things like <Q /> to be <sp /> (in example above)
  but don't I need to change that each time?


You have to have some mechanism that ties the names in a new variant to
the processing that you have already established.

You had suggested that given a variant with a new set of names
you would set up something like a list of:
<xsl:variable name="stage">stagedir</xsl:variable>
and then use this variables to parameterise every aspect of your main
transform.

A simpler and more powerfuul mechanism (as it isn't restricted just to
name changes, and can of course trivially cope with your example of sd
and stagedir mapping to the same canonical form) is to write your main
transform for one "canonical" type then when a new variant is found you
just need to write a stylesheet with templates like this:

> <xsl:template mode="normalise" match="t">
> <title>
> <xsl:apply-templates mode="normalise"/>
> </title>
> </xsl:template>

this is no harder (just fractionally more verbose) than your suggested
list of variable definitions, the result of applying these templates is
that your new variant is transformed to your canincal input form, so
then you can apply your main stylesheet.

David

-- 
http://www.dcarlisle.demon.co.uk/matthew

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

 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.