xsl-list
[Top] [All Lists]

Re: [xsl] text replacement with mixed content

2011-08-31 11:33:42
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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>