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

Re: Very simple? Text processing from document data

Subject: Re: Very simple? Text processing from document data
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Wed, 30 Jul 2008 13:31:26 +0100
Re:  Very simple? Text processing from document data
> <p>Some body <b>text</b> some more</p>
>
> And I want to replace the word 'body' only in the text of <p> but ignore
> text in <b> so I've been looking at something like this:
>
> <xsl:template match="p">
>   <p>
>        <xsl:value-of select="substring-before(./text(), 'body')"/>
>        <xsl:value-of select="'replace_body'"/>
>        <xsl:value-of select="substring-after(./text(), 'body')"/>
>   </p>
> </xsl:template>
>
> How do I separately select #text before, between and after an arbitrary
> number of interruptions (could be tables, images etc) and process those
> interruptions in document order?

Use:

<xsl:template match="p/text()">
  <xsl:analyze-string......

instead of your <p> matching template.

If you are stuck with 1.0, then you'll have to use a recursive named
template to process the string.

cheers
-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

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.