Link to home
Start Free TrialLog in
Avatar of sybe
sybe

asked on

Help me to get this XSL more compact

Coming from this question: https://www.experts-exchange.com/questions/20933294/Compact-XSL-coding.html

I have trouble writing compact XSL: the code is still too many kB. I suspect however that using some smart coding my XSL can be compacter.

The site: www.tivoli.nl (look at the "Agenda")
the XML: http://www.terminal.nl/tivoli2004/agenda/xml/nl.xml
the XSL as it was before i started compacting:  http://www.terminal.nl/tivoli2004/agenda/xml/agenda.nl.xsl.asp (35,261 bytes)
the XSL as it was after my first effort:  http://www.terminal.nl/tivoli2004/agenda/xml/agenda.nl.new.xsl.asp (29,649 bytes)

Some reduction achieved, still not satisfied. So everyone who helps me with further reduction gets points. I am only interested in a smart use of XSL functionality.

rules:
- shorter names and removing white space does not count (i can think of that myself)
- i want to reduce bandwidth use, so moving stuff to another file (which requires another HTTP request) is only valid if it reduces the total bandwidth use.
- functionality must be the same (must result in the same HTML in the browser)
- compatible with IE5+ and Mozilla.

As a rule of thumb: 100 points for every kB reduction.

ASKER CERTIFIED SOLUTION
Avatar of conorj
conorj
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of metalmickey
metalmickey

could you remove the javascript and place it in a separate document and link it to your xslt?

<script src="yourscript.js" language="JavaScript" type="text/javascript"></script>

i think at present you'll need to use a CDATA section to encapsulate the script to stop it being parsed.

MM
Avatar of sybe

ASKER

@conorj
I am currently processing your suggestions. Thanks. Watch out for a "points for" question for you.

@metalmickey
First of all removing of the javascript to outside does not help reducing bandwidth. Secondly, Mozilla browsers don't eat external javascripts in xml/xsl tranformed HTML (stylesheet is not a problem, external javascript is).
The javascript as it is now works fine.
Avatar of sybe

ASKER

@conorj

You lost me on this code. Can you please explain it?

<xsl:with-param name="bgimage" select="concat('border_', substring('foto_bottom', 1 div($isHelling)), substring('bottom_purple', 1 div not($isHelling)))" />