Questions about XSLT coding (I assume it's XSLT - you don't say) aren't really appropriate to this list, unless there is something in the question that is specific to Saxon. You should use the xsl-list at
Sounds like you need
<xsl:template match="add[matches(following-sibling::node()[1], '^p{P}')]">
That's taking you very literally: p{P} matches characters classified in Unicode as punctuation, which might not include all the characters you expect.
Michael Kay

From: [] On Behalf Of Steve Ylvisaker
Sent: 26 January 2008 17:16
Subject: [saxon] detecting content within a string

Sorry if this is not an appropriate question for this forum. But I could use some guidance.


I have the following data:


<p>Here is some text<add>and data</add>. And another sentence</p>


When I format the content in </add> I need to know that the next character in <p/> is punctuation (the period) because it changes the way a format <add/>. There must be a way to detect this but it isn’t obvious to me.


Thanks in advance for any help.