[xsl] analyze string issues

Subject: [xsl] analyze string issues
From: Terry Ofner <tofner@xxxxxxxxxxx>
Date: Mon, 24 Mar 2008 18:00:01 -0400
I am having trouble stripping numbers from a list of items. Here is a snippet of my xml:

<stem> 1. Read the sentence... </stem>
<stem> 2. What language is the word <i>defense</i> originally from?</ stem>

My current template is

<xsl:template match="stem">
	<xsl:analyze-string select="." regex="\t[0-9][0-9]?\.\t">
		<stem><xsl:copy-of select="."/></stem>

The template does what I want. It removes the tabs, numbers, and periods. But it also removes the <i> elements so that I end up with

<stem>Read the sentence... </stem>
<stem>What language is the word defense originally from?</stem>

How can I strip off the numbers and retain the inline elements of the <stem> element?

Terry Ofner

Current Thread