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

Re: Joining sibling elements

Subject: Re: Joining sibling elements
From: Marcin Miłkowski <milek_pl@xxxxx>
Date: Wed, 10 Aug 2005 23:00:50 +0200
w rpr
Joris Gillis napisaE(a):
Tempore 19:49:30, die 08/10/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Marcin MiEkowski <milek_pl@xxxxx>:

<b>this</b><b> </b><b>is</b><b> </b><b>bold<text</b>

which should be transformed this:

<b>this is bold text</b>


Here's a stylesheet that will handle this simple scenario:

Thanks, I'll try to extend it to my WordML scenario (your version seems to destroy the format and the most annoying parts are still there).


See a sample of the WordML:

<w:r><w:rPr><w:sz w:val="27"/></w:rPr><w:t>It</w:t></w:r><w:r><w:rPr><w:sz w:val="27"/></w:rPr><w:t> </w:t></w:r><w:r><w:rPr><w:sz w:val="27"/></w:rPr><w:t>is</w:t></w:r><w:r><w:rPr><w:sz w:val="27"/></w:rPr><w:t> </w:t></w:r><w:r><w:rPr><w:sz w:val="27"/></w:rPr><w:t>an</w:t></w:r><w:r><w:rPr><w:sz w:val="27"/></w:rPr><w:t> </w:t></w:r><w:r><w:rPr><w:sz w:val="27"/></w:rPr><w:t>honour</w:t></w:r><w:r><w:rPr><w:sz w:val="27"/></w:rPr><w:t> </w:t></w:r><w:r><w:rPr><w:sz w:val="27"/></w:rPr><w:t>to</w:t></w:r><w:r><w:rPr><w:sz w:val="27"/></w:rPr><w:t> </w:t></w:r><w:r><w:rPr><w:sz w:val="27"/></w:rPr><w:t>be</w:t></w:r><w:r><w:rPr><w:sz w:val="27"/></w:rPr><w:t> </w:t></w:r><w:r><w:rPr><w:sz w:val="27"/></w:rPr><w:t>here</w:t></w:r><w:r><w:rPr><w:sz w:val="27"/></w:rPr><w:t> </w:t></w:r><w:r><w:rPr><w:sz w:val="27"/></w:rPr><w:t>in</w:t></w:r><w:r><w:rPr><w:sz w:val="27"/></w:rPr><w:t> </w:t></w:r><w:r><w:rPr><w:sz w:val="27"/></w:rPr><w:t>the</w:t></w:r><w:r><w:rPr><w:sz w:val="27"/></w:rPr><w:t> </w:t></w:r><w:r><w:rPr><w:sz w:val="27"/></w:rPr><w:t>European</w:t></w:r><w:r><w:rPr><w:sz w:val="27"/></w:rPr><w:t> </w:t></w:r><w:r><w:rPr><w:sz w:val="27"/></w:rPr><w:t>Parliament</w:t></w:r><w:r><w:rPr><w:sz w:val="27"/></w:rPr><w:t> </w:t></w:r><w:r><w:rPr><w:sz w:val="27"/></w:rPr><w:t>today.</w:t></w:r>

It is a single sentence, and the translator is supposed to translate it not in MS Word, but in kind of a specialized XML editor with tags visible. The problem is that the task is to join elements <w:t> so the challenge is not really to join immediate siblings but to join (you might say "compress") same groups of tags to make <w:t> enclose more text. If I understand WordML specs the task would be to join <w:t> under the condition that <w:r> enclosing adjacent <w:t> elements contains same formatting tags.

But from your answer I see that this is possible using XSLT (that was my original question) although because of the recursion involved the processing would probably take some time.

Thanks again,
	Marcin

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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