Re: Find content between <text:change-start /> and <text:change-end />
Dave Pawson <[email protected]> Thu, 18 Feb 2010 13:18:51 +0000
| Newsgroups | gmane.comp.openoffice.devel.xml |
|---|---|
| Message-ID | <[email protected]> |
On 18 February 2010 13:11, ashok _ <[email protected]> wrote: > Many many thanks for following up with more questions -- I was finally > able to get the correct expression. > > //text:change-start[@text:change-id='ct-472232592']/following::text()[not(preceding::text:change-end[@text:change-id='ct-472232592'])] > > I am doing it relative to the document root thats why i have // instead of .// Try testing with <text:change-start text:change-id="ct472232592"/>Change start</text:p> <text:p text:style-name="Standard">Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?<text:change text:change-id="ct472209600"/> Unchanged</text:p> I.e. do you pick up the text on the end of the current para element? <xsl:template match="text:section"> <xsl:variable name='t' select='.//text:change-start/@text:change-id'/> <xsl:message> [<xsl:value-of select=".//text:change-start/following::*[1][text()]"/> ] </xsl:message> <diff> <xsl:value-of select=".//text:change-start/following::*/text()[not(preceding::text:change/@text:change-id=$t)] | .//text:change-start/text()"/> </diff> </xsl:template> Gets 'most' of it, misses the 'Change start' text. HTH -- Dave Pawson XSLT XSL-FO FAQ. Docbook FAQ. http://www.dpawson.co.uk