Re: [xsl] regular expression question

Subject: Re: [xsl] regular expression question
From: "M. David Peterson" <m.david@xxxxxxxxxx>
Date: Sun, 14 Nov 2004 16:08:06 -0800
Just as I hit send on that last one I realize that specifying which text() node to use in the test was pretty much pointless given that there can only be ONE text node before or after any given element.... One of those "duh" realizations you get when its too late to change it... :)

Cheers,

<M:D/>


Bruce D'Arcus wrote:


I'm not really that familiar with regular expressions (beyond the basics), nor with the specifics of their implementation in XSLT 2.0. How easy is it to have regexp code that can take this:

<para>Acccording to Doe <citation><biblioref linkend="doe99"/></citation> ...</para>

.... and to see that while standard processing code would yield this:

<p>According to Doe (Doe, 1999) ...</p>

.... the author name is preceding the citation, such that the output should be:

<p>According to Doe (1999) ...</p>

?

Put differently, would there be a good way to look at the text immediately preceding a citation (probably in the entire sentence preceding it) to see if the author is noted there?

I should add that historically (in bibtex for example), the author would manually code the citation to indicate how it should be rendered. I'm just wondering if that's really necessary, and perhaps simply awkward (for example, in a GUI app, it means requiring some sort of interface for the author to indicate how it ought to be rendered, while using the approach I'm suggesting above would be much simpler).

Bruce

Current Thread