Re: [xsl] text replacement with mixed content

Subject: Re: [xsl] text replacement with mixed content
From: Liam R E Quin <liam@xxxxxx>
Date: Wed, 31 Aug 2011 12:32:59 -0400
On Wed, 2011-08-31 at 17:01 +0200, Geert Bormans wrote:

>      <test id="7">
>          <in original="this old foo is breaking" revision="a new bar 
> is building" >
>              <p><b type="stronger">I <i>did not realize that this 
> </i></b>old foo is breaking <i>this old foo</i></p>
>          </in>
>          <out>
>              <p><b type="stronger">I <i>did not realize that 
> </i></b><rev>a new bar is building</rev> <i>this old foo</i></p>
>          </out>
>      </test>

I hadn't seen this test case when I replied before.

The regular expression approach can still be used, but it starts to get
tricky.   I'd probably use the regular expressions in Perl to add empty
(milestone) markers, e.g. <start phrase="p3"/> and <end phrase="p3"/>,
where p3 is the id of the phrase in a separate XML document... then I'd
use XSLT or XQuery to sort out the mess afterwards :-)

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org www.advogato.org

Current Thread