Subject: Re: [xsl] variable matching... From: David Carlisle <davidc@xxxxxxxxx> Date: Mon, 8 Dec 2003 13:15:14 GMT |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] variable matching..., James Cummings | Thread | RE: [xsl] variable matching..., Jarno . Elovirta |
Re: [xsl] variable matching..., David Carlisle | Date | RE: [xsl] Too slow to process XML f, Jack Yang |
Month |