[xsl] Closing and reopening hierarchically structured elements

Subject: [xsl] Closing and reopening hierarchically structured elements
From: "Huditsch Roman" <Roman.Huditsch@xxxxxxxxxxxxx>
Date: Mon, 14 Feb 2005 13:14:10 +0100
Hi,

I am facing a problem which I don't know how to tackle.
I am currently doing an XML to FO transformation.
The produced FO documents have two columns.
My problem now is, that I want my tables to span
over all two columns.
I think that I can only achieve that using a two-step approach.

1. Create a basic fo structure
2. Rearrange table markup

The second step involves closing all ancestor elements before my table.
Generating an <fo:block span="all">, including my table markup within
and re-opening my closed ancestor elements (including all attributes
defined before).


structure after 1:

<fo:flow>
	<fo:block ... >
		<fo:block ...>
			<fo:inline>
				<table>
					...
				</table>
			</fo:inline>
			...
		</fo:block>
	</fo:block>
</fo:flow>


structure after 2:

<fo:flow>
	<fo:block ... >
		<fo:block ...>
			<fo:inline/>
		</fo:block>
	</fo:block>
	<fo:block span="all"">
		<table>
			...
		</table>
	</fo:block>
	<fo:block ... >
		<fo:block ...>
			<fo:inline>
			...



Since I don't know on which hierarchical level my tables appear I would
need some kind of
generic algorythm to close an re-open my ancestors.

Can you give me some hint, how to achieve this?
Is there any way to do this during my first XML => FO transformation?

wbr,
Roman

Current Thread