[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

access to preceding-sibling in a sorted list

Subject: access to preceding-sibling in a sorted list
From: "Simon Ruf" <ruf.simon@xxxxxxxxx>
Date: Tue, 4 Sep 2007 14:26:39 +0200
 access to preceding-sibling in a sorted list
Hi!

I'm using xslt 1 with PHP to create a XHTML output for a address book
stored in my own (I can change it, if necessary) xml format which
looks basically like this (will be around 500 "<card>":
<box>
  <card type="person">
    <full-name>Simon Ruf</full-name>
  </card>
  <card type="person">
    <full-name>Elizabeth Noname</full-name>
  </card>
  <card type="person">
    <full-name>Jack</full-name>
  </card>
  <card type="person">
    <full-name>Emanuel Ruf</full-name>
  </card>
</box>

The Ouput is a long sorted (by xsl:sort) <ul>-List. I'd like to jump
to the entries beginning with "e" by an xhtml-anchor. For that I need
to put an id="E" to the first entry beginning with e. In the end it
should look like this:
<ul>
  <li id="E">Elizabeth Noname</li>
  <li>Emanuel Ruf</li>
  <li id="J">Jack</li>
  <li id="S">Simon Ruf</li>
</ul>

I've tried to achieve this by saving the current first letter to a
xsl:param but I couldn't change the value of the global parameter from
within the template.
Then I tried to access the value of the preceding sibling but this
would only get me the values of the preceding sibling in the
unsorted-list. (e.g. while processing the card of Emanuel Ruf it would
get me the value "Jack" instead of "Elizabeth Noname")

If there's a way please let me know.

Thanks,
Simon Ruf

http://simonruf.de/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.