xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Kellstrand <kellstr...@yahoo.com>
Subject RE: Dimension math, i.e. width="{$x+10}"
Date Thu, 03 Jun 2004 18:32:48 GMT
A very interesting discussion.
I tried the latest suggestion:
and got an error:
[ERROR] svg graphic could not be built: null:-1
The attribute 'height' of the element <rect> is invalid
org.apache.batik.bridge.BridgeException: null:-1
The attribute 'height' of the element <rect> is invalid
I guess it doesn't want to add numbers with units ....
Thanks,  Mike

"Andreas L. Delmelle" <a_l.delmelle@pandora.be> wrote:
> -----Original Message-----
> From: Mike Kellstrand [mailto:kellstrand@yahoo.com]


> 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
> feel free to educate me further.

Well, Clay was right (and IIC, I'm the one who corrected Clay in the thread
he remembered) and the problem is actually that it's Xalan (or any other
XSLT processor for that matter) that can't add numbers to strings...

You may want try:


In this way, the value of the width property that FOP gets to see is, for


in which case FOP should have no problem with it. Right now you're trimming
the measurement units and have Xalan do the calculation, and FOP gets to see
for example:


which comes down to the same thing, of course, but wouldn't be usable if the
'10px' were to be an expression in itself rather than a literal value.




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

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