This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Checking the text nodes just preceding the context
- To: "XSL Mailing List (E-mail)" <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] Checking the text nodes just preceding the context
- From: Adam Van Den Hoven <Adam dot Hoven at bluezone dot net>
- Date: Wed, 26 Sep 2001 20:13:17 -0700
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi,
I have a series of prose documents that have some semantic markup that will
be replaced with a string. Since I need to maintain proper capitalization I
need to check the text that immediately precedes the context to see if it
ends in a period ( or a period and a space).
So lets say I have the following:
<doc>
<p> some interesting text here. Some <foo/> more intersting text</p>
<p> some interesting text here. <foo/> some more intersting text</p>
<p> some interesting <b>text here.</b> <foo/> Some more intersting
text</p>
<p> some interesting text here. <b><foo /> some</b> more intersting
text</p>
</doc>
The output of this should be be (assuming an identity transform as the
basis):
<doc>
<p> some interesting text here. Some foo more intersting text</p>
<p> some interesting text here. Foo some more intersting text</p>
<p> some interesting <b>text here.</b> Foo Some more intersting
text</p>
<p> some interesting text here. <b>Foo some</b> more intersting
text</p>
</doc>
Now I can guarantee that <foo> will be child of <p> but nothing else.
Any ideas how to do this?
Adam van den Hoven
Internet Software Developer
Blue Zone
tel. 604 685 4310 ext. 260
fax 604 685 4391
> Blue Zone makes you interactive. http://www.bluezone.net/
>
>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list