xsl-list
[Top] [All Lists]

Re: Concatenating a nodeset (set of attributes)

2005-10-09 04:25:42
Hi Geert,

On 10/8/05, Geert Josten <Geert(_dot_)Josten(_at_)daidalos(_dot_)nl> wrote:
The depth of the STRUC elements is arbitrary.

If you know there is a resonable limit to the recusion depth you could do the 
following:

Well, I would guess that no Table Of Contents will have 10 levels.


<xsl:sort select="number(concat(@pos, '.', STRUCT/@pos, STRUCT/STRUCT/@pos,
STRUCT/STRUCT/STRUCT/@pos, ...)" data-type="number" />


Very smart with making the value a real number (as opposed to an
integer). This will make the sorting work even on TOC fragments of
different depths. The only problem in this is the case of pos="14" as
opposed to pos="2". I have never used format-number before, but I
guess that this would be what it would be good for:
<xsl:sort 
select="number(concat(@pos,'.,STRUC/STRUCT/format-number(@pos,'00'),..."
data-type="number"/>

But this sure is unwieldy, and now we have two conditions: that the
depths is less than a certain number and that there are no more than
99 child nodes to a given structure element.

Otherwise I would suggest a multistep process or refering to extensions..

Well, extensions I can certainly make myself, but I haven't been able
to find a multistep process to doing this. I am very curious on how to
do this.

Thanks,
Ragulf Pickaxe :-)

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--