Re: [xsl] alphabetic counters

Subject: Re: [xsl] alphabetic counters
From: Nicholas Shanks <contact@xxxxxxxxxxxxxx>
Date: Tue, 11 May 2004 02:27:54 +0100
On 10 May 2004, at 20:18, Passin, Tom wrote:

You just need to start thinking in terms of taking a set of nodes and
operating on them, rather than in terms of spitting out bits and pieces
in order.

Thanks again to all of you (sorry, went to London for six hours :)
I just got back, read your emails and had a think about node trees and such.


I'm now doing this:

for-each select="star"
  sort stars
  for-each select="planet"
    sort planets
    if position = 1
      <th rowspan="{count(../planet)}"><value-of ../starname></th>
    /if
   <td>'s go here
  /for-each
/for-each	

It works and is better than cdata everywhere, but using ../ still feels like a hack.
So for people keeping score, Sablotron now fails to output anything matching on id() but the other three all work. Libxslt sorts differently when matching non-existant nodes and is about 8x faster than Saxon and Xalan, but that's it.
Also, Mozilla now displays something, but it's not very good (cannot seemingly handle variables nor id() selectors)


I will look at keys tomorrow morning. Must sleep :)
Thanks again everyone.

On 10 May 2004, at 19:52, Andreas L. Delmelle wrote:

Right now, it seems you are only using one template to control the entire
transformation. Unfortunately, the XSL and the HTML are the only files I can
view from the links below (dtd is in the wrong location, or is referenced
improperly from the xml?):
If you want to take a look at everything, these are the URLs:
http://astro.nickshanks.com/library/extrasolar.en.html > HTML after
processing
http://astro.nickshanks.com/library/extrasolar.xml
http://astro.nickshanks.com/stylesheets/extrasolar.xsl
http://astro.nickshanks.com/dtds/extrasolar.dtd

All four URIs are valid. After downloading the XML file you will need to change the DTD reference in the doctype so it works on your lan. it was easier for me to just put //astro/ for testing than to reconfigure my machine to search NetInfo before DNS so it would resolve a FQDN to a 192.168 address. :-)


- Nick.

Current Thread