This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: The longest node in a node set
- From: Antonio Fiol Bonnín <fiol at w3ping dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Fri, 19 Jul 2002 12:53:34 +0200
- Subject: Re: [xsl] The longest node in a node set
- References: <9B66BBD37D5DD411B8CE00508B69700F024A78A1@pborolocal.rnib.org.uk>
- Reply-to: xsl-list at lists dot mulberrytech dot com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Thank you Dave, Mike and Jeni!
Dave, I was actually thinking of getting the length, not the node. So
both Jeni's and Mike's approaches could work.
However, I have just discovered that I need something far more complex. :-(
The idea was obtaining the max length for all the "column" elements that
may go in a table cell, and then use that number as the argument to
proportional-column-width in XSL-FO. That way I would get a table with
proportional space depending on the max size of the content. Nice idea,
but...
I did not take into account the fact that longer contents are splitted
into two rows at spaces. That changes the formula: I would have to find
"the length of the longest word contained in an element". That would not
change a lot Jeni's recursive approach, except that it would have to be
douoble-recursive to find the length of the words. But never mind. This
is certainly not the best solution, as I have a very irregular
distribution of maximum "word" lengths. So the final result would not be
appealing.
I think I would better go for a hypenation approach. Not that I want
real English words hyphenated, but the idea is as follows:
I have long things like:
0123456-987654-784112-AS-666
This could probably be split as:
0123456-987654-784112-
AS-666
Is there a way to tell the FO renderer that it can cut a word at a
specific place? Some sort of zero length space that must be interpreted
by the FO renderer as exactly that, a space (in the sense of something
that is between words), but 0 length (i.e. Do not draw it if the word is
not splitted).
Or does anyone see a better approach?
Thank you very very much!!
Antonio
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: Using GnuPG with Debian - http://enigmail.mozdev.org
iD8DBQE9N++uCEvxyR+MqTQRAs0RAJ9545ziA+hqvD+BBtG0kMuXFwuUgQCeJzMb
6rSvvUogco90vD/A9ThMKy4=
=l5sa
-----END PGP SIGNATURE-----
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list