Re: [xsl] Aligning Parallel Columns

Subject: Re: [xsl] Aligning Parallel Columns
From: Jeroen Hellingman <jeroen@xxxxxxxx>
Date: Sat, 15 Jan 2011 18:20:18 +0100
On 2011-01-15 17:43, Michael Kay wrote:
> OK, let's see whether it can be done if the name attribute are
> randomized, so that you can't rely on them for sorting. Is that what
> you're looking for?

Yes, what I was looking for is that the order of the name attribute wouldn't
be important, so that inserted paragraphs in the translation need not
get a carefully constructed id that sorts correctly.

> This immediately raises the question of what happens if one sequence is
> (A, Z, B) and the other is (A, X, B) - what order do Z and X appear in?

For the purpose I have in mind, the order in that case is not really
important. They could even be lined up...

> I think I would tackle it as follows. Call a para an anchor para if
> there is a para in the other list with the same name. For each anchor
> para in the first list, output a table row containing it and its twin
> from the other list. Then output all the non-anchor paras from the first
> list up to the next anchor, then all the non-anchor paras from the
> second list up to the next anchor, then the next anchor pair and so on.

I will try the solution along the lines you describe. (after cooking
dinner... :-)

Jeroen.

Current Thread