Sorry about the missing backslash. My laptop has a temperamental backslash key.
 
Michael Kay
http://www.saxonica.com/


From: saxon-help-bounces@lists.sourceforge.net [mailto:saxon-help-bounces@lists.sourceforge.net] On Behalf Of Steve Ylvisaker
Sent: 26 January 2008 18:19
To: Mailing list for SAXON XSLT queries
Subject: Re: [saxon] detecting content within a string

Thanks – will do that in the future. However, in this case I received the following error:

 

Description: Error at character 3 in regular expression "^p{P}": expected digit in quantifier

 

My implementation was:

 

<xsl:template match="add[matches(following-sibling::node()[1], '^p{P}')]">

          <fo:wrapper text-decoration="underline">

           <xsl:apply-templates/>

     </fo:wrapper>

</xsl:template>

 

Steve

 


From: saxon-help-bounces@lists.sourceforge.net [mailto:saxon-help-bounces@lists.sourceforge.net] On Behalf Of Michael Kay
Sent: Saturday, January 26, 2008 11:30 AM
To: 'Mailing list for SAXON XSLT queries'
Subject: Re: [saxon] detecting content within a string

 

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 mulberrytech.com.

 

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

http://www.saxonica.com/

 


From: saxon-help-bounces@lists.sourceforge.net [mailto:saxon-help-bounces@lists.sourceforge.net] On Behalf Of Steve Ylvisaker
Sent: 26 January 2008 17:16
To: saxon-help@lists.sourceforge.net
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.

 

Steve