[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

analyze string issues

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

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


My current template is

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


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


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

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

Terry Ofner

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.