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

Aligning Parallel Columns

Subject: Aligning Parallel Columns
From: Jeroen Hellingman <jeroen@xxxxxxxx>
Date: Sat, 15 Jan 2011 13:11:05 +0100
 Aligning Parallel Columns
I have two texts, one being the translation of the other. I want to
print them side by side in an HTML table, such that translated
paragraphs are aligned.

Sometimes, additional paragraphs have been added in the translation, and
sometimes, paragraphs have been merged, so the relationship is not
always one-on-one, but corresponding paragraphs will have the same id
in both documents.

e.g., documents one and two:

        <div id="ch1">
            <p name="a1">Eerste Alinea.</p>
            <p name="a1.1">Zomaar ertussen.</p>
            <p name="a2">Tweede Alinea.</p>
            <p name="a3">Derde Alinea.</p>
        </div>

        <div id="ch2">
            <p name="a1">First Paragraph.</p>
            <p name="a2">Second Paragraph.</p>
            <p name="a2.1">Something added here.</p>
            <p name="a3">Third Paragraph.</p>
        </div>

And the result I wish to produce looks something like:

    <table>
        <tr><td>Eerste Alinea.</td>  <td>First Paragraph.</td></tr>
        <tr><td>Zomaar ertussen.</td><td/></tr>
        <tr><td>Tweede Alinea.</td>   <td>Second Paragraph.</td></tr>
        <tr><td/>                       <td>Something added here.</td></tr>
        <tr><td>Derde Alinea.</td>   <td>Third Paragraph.</td></tr>
    </table>

Technically, this is a kind of full outer join of both documents.

Any suggestions on how to tackle this with XSLT (2.0 welcome)?


Jeroen Hellingman

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.