[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] analyze-string question

Subject: Re: [xsl] analyze-string question
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxx>
Date: Mon, 29 Oct 2012 14:05:17 -0400

Hi David,

As Gerrit's response suggests, you have two separable problems here:

1. Parsing the plain text input and mapping it into XML

2. Properly interpreting your markup syntax given its semantic
overloading of < and > (as both accent-indicators bound to the next
character only, and start- and end-tags for "alt" segments).

An EBNF or other formal language specification would help with both of
these problems together, but short of that, it'll be easier to tackle
if you separate them.

Gerrit's idea of using the character following the < or > to
disambiguate it is one approach. But you can only tell if it covers
your case by looking at your actual data and rules.

So, for example, you say


should become

DRUG<stress>O</stress>J MO <alt>MS-P <alt>P 3V</alt></alt>

so how do we know it shouldn't be this?

DRUG<alt>OJ MO <alt>MS-P <stress>P</stress> 3V</alt></alt>


Wendell Piez | http://www.wendellpiez.com
XML | XSLT | electronic publishing
Eat Your Vegetables

Current Thread