- Just out of curiosity, can anyone suggest a practical application for the

abs() function as defined by section 5.10.1 of the CR?

I can certainly see that the numbers you'd be dealing with in an XSL-FO

context (e.g., column numbers, dimensions, page numbers, colors...) ought

to be greater than 0. What I'm having a hard time imagining is how they'd

start out less than 0 in the first place, and therefore need "correction"

using abs().

Can anyone provide a practical use case for abs(), other than a simple

desire for completeness?

(The spec, not surprisingly, seems to include only one occurrence of the

string "abs(" -- that being in section 5.10.1 itself. Anyone have any idea

how the "core function library" in general applies to conformance? Are all

core functions assumed to be part of XSL-FO at the basic conformance level?)

================================================================

John E. Simpson | "I have a microwave fireplace.... The

http://www.flixml.org | other night I laid down in front of

XML Q&A: www.xml.com | the fire for the evening in two minutes."

| --Steven Wright - I can't answer your specific question about a practical application for

abs() because I haven't used XSL-FO yet, but I can offer this: abs() is

often used to find the positive difference between two numbers (or

sub-expressions) without having to know which is the bigger and which is the

smaller. For example, to get the difference between A and B you could say

abs(A-B) OR abs(B-A).

Dave.

----- Original Message -----

From: "John E. Simpson" <simpson@...>

To: <XSL-FO@yahoogroups.com>

Sent: Friday, April 13, 2001 8:15 PM

Subject: [XSL-FO] Wherefore abs()?

> Just out of curiosity, can anyone suggest a practical application for the

> abs() function as defined by section 5.10.1 of the CR?

>

> I can certainly see that the numbers you'd be dealing with in an XSL-FO

> context (e.g., column numbers, dimensions, page numbers, colors...) ought

> to be greater than 0. What I'm having a hard time imagining is how they'd

> start out less than 0 in the first place, and therefore need "correction"

> using abs().

>

> Can anyone provide a practical use case for abs(), other than a simple

> desire for completeness?

>

> (The spec, not surprisingly, seems to include only one occurrence of the

> string "abs(" -- that being in section 5.10.1 itself. Anyone have any idea

> how the "core function library" in general applies to conformance? Are all

> core functions assumed to be part of XSL-FO at the basic conformance

level?)

>

> ================================================================

> John E. Simpson | "I have a microwave fireplace.... The

> http://www.flixml.org | other night I laid down in front of

> XML Q&A: www.xml.com | the fire for the evening in two minutes."

> | --Steven Wright

>

>

> To unsubscribe from this group, send an email to:

> XSL-FO-unsubscribe@egroups.com

>

>

>

> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

>

> - Dave Hartnoll wrote:

> I can't answer your specific question about a practical application for

Thanks for the reply, Dave. I'd taken the list's silence for assent. :)

> abs() because I haven't used XSL-FO yet, but I can offer this: abs() is

> often used to find the positive difference between two numbers (or

> sub-expressions) without having to know which is the bigger and which is the

> smaller. For example, to get the difference between A and B you could say

> abs(A-B) OR abs(B-A).

That's a good point, too -- about using abs() to express not the

absolute value of a single number, but of the difference between two --

and one I should have thought of myself. In XSL-FO terms, maybe this

might be useful given the absolute positions and sizes of two areas, in

determining the distance from one area to the next....

I'll think some more on it. Thanks again.

================================================================

John E. Simpson | "When I was a little kid we had a sand

http://www.flixml.org | box. It was a quicksand box. I was an

XML Q&A: www.xml.com | only child... eventually." (Steven Wright)