If you're interested in functional programming, you might also want to checkout my second blog which i'm actively working on!!

Friday, May 8, 2009

Calculating rowspan for cellmerging

Ok... Here is a small demo that shows you a way how to calculate the rowspan.

contacts.xml will be the starting point for this exercise.




















In a first step we do a little xml to xhtml conversion in order to view our data in a table.

contacts2html.xslt:





















The result is the following:










Now suppose we want to merge cell's in the city column.

mergecells.xslt snippet:












The final output looks like this:











This demo shows you it's quite easy to calculate the rowspan using the 'deep-equal' function recursively.

Cheers,
Robby

2 comments:

  1. Nice Robby, which tool do you use for XML files and making these nice snapshots?
    --
    Danny

    ReplyDelete
  2. I use Altova XML spy (and it's eclipse plugin) for working with everything XML related. For screenshots I always use screenhunter 5.0 which is free and easy to use.

    --
    Robby

    ReplyDelete