This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: different crosstables from xml data


Hi Ingo,

> How can I get the colspan / rowspan information? Has someone done
> this before?

When you're calculating column spans, you need to look at the number
of columns that don't themselves have column children. You can find
columns that don't have column children with:

  column[not(column)]

You can find all such column elements under the current column element
with:

  .//column[not(column)]

And you can count how many there are with the count() function:

  count(.//column[not(column)])

To ignore the relative columns, you could use:

  count(.//column[not(column)][@type != 'relative'])
  
You could use the same kind of technique to find rowspans.

> Or should I generate different XML-Source for a better xslt
> processing?

Obviously the closer the XML source document is to the result that you
want, the easier it's going to be for the XSLT to process it. If you
generate something that has the same structure as the table element
you want to produce, then you hardly have to do any transformation. I
think the main thing that would make it easier would be if you only
included the absolute/relative columns in the source XML if you wanted
to have them present in the output.

I wasn't sure from your message whether you wanted help with the rest
of the transformation; let us know if you do.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]