Re: [xsl] Identifying patterns within texts

Subject: Re: [xsl] Identifying patterns within texts
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 28 Nov 2007 16:40:48 -0500
Jim,

The short answer is that while XSLT 1.0 wasn't designed for this sort of work (which we call "upconversion" for various interesting reasons), XSLT 2.0 does have facilities that make it possible, at least in reasonably well-controlled cases. In particular, have a look at the xsl:analyze-string element.

The more complete answer is that how tractable you find your problem to be will depend more on your definition of the problem itself than on XSLT's native capabilities, and indeed that if you can define the problem sufficiently to get a handle on it at all, XSLT is probably, at this point, as good a technical means as any available for solving it. (Modulo issues of scale, architecture etc.)

So, in your case, one would have to start by defining what you mean by "attempt to detect math". What is this "math" of which you speak, and how do I know it's there?

Cheers,
Wendell

At 04:24 PM 11/28/2007, you wrote:
Well I am 4 days into understanding XSLT (and well 4 days into fully
understanding xml).  I am working on a file conversion utility where it
would be an xml to xml conversion.  In my research, I came across XSLT
(along with XSL, XSL-FO,  XSD, DTD, etc).  My question is the following,
if I have an element with text in it:

<item>What is 1/2 in decimal format?</item>

Is there a way using a style sheet to actually manipulate the text such
that the resulting output would be:

              < question>What is <math>1/2</math> in decimal
format</item>

Basically, I need to search through the text of an element and attempt
to detect math?  Most of the tutorials use xml to HTML as an example and
play with elements and attributes.  I was just wandering if the XSLT
spec allows for this type of searching/parsing?

Thanks,

Jim Themis





====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================

Current Thread