This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Checking the text nodes just preceding the context


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]