Subject: [xsl] Getting position of parent From: Geoff Hankerson <ghank@xxxxxxxxxxx> Date: Thu, 20 Feb 2003 09:05:41 -0600
I have the following xml which I am transforming into html. The xml was
generated by a prcoess of converting pdf documents to svg then our own
xml. The key is we retain information on the positioning of elements.
Here is what it looks like:
So I use xsl to transform this to html using inline css for positioning,
fonts info and the like. Here is the xsl:
<xsl:output method="html" media-type="print" encoding="unicode"/>
Works great except for multipage documents will assume the "top"
position is the same no matter if you are on the first or a subsequent
page. So if the the text "Test Text" exists at top=400 left =400 on
pages 1 and 2 the above xsl will just place them right on top of each
other. So I came up with the idea of a page offset of 1056 pixels per
page. So the only challenge is to figure out how to tell which page in
the pages node you are on so that the top value can be calulated
something like this <xsl:value-of select="(@Top * 0.06666) +
($pageNumber * $pageHeight)"/>.
So what I want to do is make $pageNumber = position() -1 for the page
node while I am in the (grandchild) Field node. How can I accomplish
this? I'm scratching my head on this one