xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clay Leeds <cle...@medata.com>
Subject Re: Dimension math, i.e. width="{$x+10}"
Date Thu, 03 Jun 2004 14:56:14 GMT

On Jun 3, 2004, at 7:37 AM, Mike Kellstrand wrote:
> I need to layout some blocks and SVG's using dimensions
> based on input values.  I can easily use the original input values,
> i.e.  width="{$x}",   but I also need to do some calculations.
>
> For instance, if I want a box around my SVG, I need to either
> draw it in the SVG at 1px smaller or use a block-container at 1px 
> larger.
>  
> I've tried some examples I've found online (like  width="{$x+10}"  ),
> but FOP doesn't like it.
>
> What is the correct syntax for doing this type of thing?
>  
> Thanks,  Mike

I *think* the problem is that $x probably is equivalent to '1px' which 
is a string of the characters '1'+'p'+'x' and there may be difficulties 
with adding a number to a string. There is a recent discussion on this 
in the archives, where someone provided some insight into how I was not 
completely correct on that assumption with one aspect of XSL-FO (I 
don't recall exactly which at the moment) however, that discussion may 
not be appropriate for SVG calculation (I don't know).

What should be possible, is for you to modify your system to strip the 
'px' for the purposes of the calculation with something like:

   width="{concat(substring($x,length()-2)+10,'px')}"

I *hope* that'll do the trick, but you should see where I'm trying to 
go with it...

Hope this helps!

Web Maestro Clay

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Mime
View raw message