Clay,
 
Thanks a lot, that did the trick for me.
 
Not to nit-pick, but for posterity, the syntax I ended up with is:
 
width="{concat(substring($width,1,string-length($width)-2)+10,'px')}"
 
If anyone else wants to chime it with any of the subtler details of this stuff,
feel free to educate me further.
 
Thanks Clay,
 
Mike


Clay Leeds <[EMAIL PROTECTED]> wrote:

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger

Reply via email to