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

Re: Matching string values across element boundaries

Subject: Re: Matching string values across element boundaries
From: Michael Müller-Hillebrand <mmh@xxxxxxxxx>
Date: Mon, 8 Apr 2013 20:58:49 +0200
Re:  Matching string values across element boundaries

Can you give a more complex example, how "variable in structure" those
citations may be. This may also shed some light on the kind of processing you
want to do. Changing tags to characters (why are you using ASCII instead of
some high Unicode character from the private use area?) and then back to tags
seems not a very interesting thing

- Michael

Am 08.04.2013 um 20:15 schrieb David Sewell <dsewell@xxxxxxxxxxxx>:

> I expect this has been discussed here before, but I can't locate any
> discussion, so here goes.
> We have input data with many unmarked short-title citations that look like
>   Sprague, <hi rend="italic">Braintree Families</hi>
> We want to wrap them inside another element, in our case a <ref> to the
> bibliographic expansion. We have a venerable chain of XSLT 2.0 transforms
> does this, and pretty well, by preprocessing the data to convert all those
> tags into a pair of unique ASCII characters, so that we can do
> operations within a single text node that now includes something like
>   Sprague, "Braintree Families%
> which is easy to handle with xsl:analyze-string. then once we've wrapped all
> strings we need to, we post-process with xsl:analyze-string to put the <hi>
> elements back in.
> In practice, given the proper regexes, this works quite well and provides
> desired output, but I always feel a bit guilty about the hackishness of the
> approach. Given that the citations are quite variable in structure (usually
> not always containing <hi> elements, with various combinations of text nodes
> start and end), I've never come up with a good general-purpose way to
> purely on elements and text nodes without the convert-tags-to-characters
> Is there one (or more)?
> David S.

Current Thread


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.
First Name
Last Name
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.