Re: [XSL-FO] Positioning Node Members Dynamically in a Table
- Shawn, here's one way to turn a <list> of <item>s into a 2-column table in
<xsl:param name="nth-item" select="1"/>
<xsl:when test="$nth-item > count(item)"/>
select="item[position() >= $nth-item and
position() < $nth-item + 2]"/>
<xsl:with-param name="nth-item" select="$nth-item + 2"/>
You could parameterize the number of columns instead of hard-code it at 2.
It's a little trickier to get column-major ordering, but not bad once you
understand it. A similar approach to produce HTML tables is illustrated at
this doesn't help, post again and I'll explain it more fully.
Paul Tyson, Principal Consultant Precision Documents
"The art and science of document engineering."
----- Original Message -----
Sent: Tuesday, October 02, 2001 7:54 AM
Subject: [XSL-FO] Positioning Node Members Dynamically in a Table
> Well, the title pretty much says it all, doesn't it?
> I need to dynamically position members of a node set in one of two
> columns in a table. I'm looking to be able to produce a list like:
> 1 2
> 3 4
> 5 6
> 1 3
> 2 4
> 3 6
> I'm not fussy about exactly how.
> Any ideas?
> To unsubscribe from this group, send an email to:
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
- At 07:54 2-10-2001, shawnlstroud@... wrote:
>Well, the title pretty much says it all, doesn't it?Perhaps... do you really mean "dynamically"?
>I need to dynamically position members of a node set in one of twoYou can produce an FO table that orders a list in row-major or column-major
>columns in a table. I'm looking to be able to produce a list like:
fashion, but either transformation is going to be static. If that's all
you're asking, then Paul's row-major solution will work, and there are
examples in Jeni Tennison's grouping FAQ about producing HTML tables in
column-major order (see <URL: http://www.jenitennison.com/xslt/grouping/ >)
If you're looking for something truly dynamic, you could use the multi
objects, but I don't know of any system that actually supports those yet.
Christopher R. Maden, Principal Consultant, HMM Consulting Int'l, Inc.
DTDs/schemas - conversion - ebooks - publishing - Web - B2B - training
<URL: http://www.hmmci.com/ > <URL: http://crism.maden.org/consulting/ >
PGP Fingerprint: BBA6 4085 DED0 E176 D6D4 5DFC AC52 F825 AFEC 58DA
- --- In XSL-FO@y..., "Christopher R. Maden" <crism@m...> wrote:
> At 07:54 2-10-2001, shawnlstroud@y... wrote:Well, by "dynamically" I mean that I don't know the number of nodes
> >Well, the title pretty much says it all, doesn't it?
> Perhaps... do you really mean "dynamically"?
in the result tree, so I need to be able to sort and arrange the
nodes on the fly.
Hmmm. I bet there's a better word for that than "dynamic."
Anyway, thank you for your quick response. I'm checking out and
testing the code examples and suggestions today.