|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Using xsl:variable and replace() to remove specifi
On 28/04/2008, Richard Corfield <richard.corfield@xxxxxxx> wrote: > <label>2</label>National Radio Astronomy Observatory, Chile<xref ref-type="fn" rid="aj266199afn4"><sup>9</sup></xref>; <ext-link ext-link-type="email" id="aj266199em4">email address here</ext-link> > </aff> > The problem is the trailing semi-colon between the <xref> & <ext-link> elements. If it's exactly that problem and those elements can occur anywhere you can do: <xsl:template match="text()[preceding-sibling::*[1][self::xref]] [following-sibling::*[1][self::ext-link] [normalize-space(.) eq ';'"]"/> ...which is a no-op template for text node that only occur between <xref> and <ext-link> elements with a value of a colon possibly nestled amongst some whitespace. You will have to ensure you always use <xsl:apply-templates/> instead of <xsl:value-of select="..."/> when outputting the value of an element otherwise the template won't get fired (that's always good practice anyway) If you only ever want to remove the colon from within certain elements (like <aff> above) then modify the match to be: match="aff/text()".... to prevent the text() matching template firing for all text() nodes, which might be expensive. -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Cast Your Vote
We need your help – Vote for DataDirect XML Products!
Winners and finalists announced at SOA World Conference in November. Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|







