[xsl] Beginner seeking advice

Subject: [xsl] Beginner seeking advice
From: Trine Løcke <trine@xxxxxxxxx>
Date: Thu, 08 Feb 2007 21:46:50 +0100
Hello all,

This is my first try at doing something with XSL. I'm actually quite
happy with the result, as it does what I need doing. But still I am a
beginner and as such I'm sure I've done a bundle of stuff the wrong way,
or perhaps there are glaring bugs in the XSL that I've not been able to
weed out.

I was hoping some of you veteran XSL programmers could perhaps find some
time to comment on what I've done here, and perhaps even point me in the
right direction where improvements could be made.

The XML file can be seen here: http://gozza.dk/test/test1.xml

The XSL file can be seen here: http://gozza.dk/test/test1.xsl

The final output can be seen here: http://gozza.dk/test/test.xml

I know the HTML is ugly as heck, but that's not important.  :o)

I have no control over the XML format, and under normal circumstances
the file is approx 1500-2000 lines long. The viewer is either Firefox or
Opera, so those are the only processors I've tested this with.

Personally I'm a bit annoyed at having two named templates (pris and
totalpris) that are so similar. There must be a better/prettier way?

Also I'm having problems with the result of "totalpris" being different
from the sum of all the "pris" calculations. I'm sure this has something
to do with how I'm using ceiling(), but I can't quite figure out how to
do it differently.

Please don't put the hammer down too hard on me. This is my first try at
anything beyond HTML and CSS. It's all very new to me, and after a good
long day of trying to learn XSL, my brain is actually hurting a bit.  :o)


Current Thread