Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] access to preceding-sibling in a sorted list

From: "Simon Ruf" <ruf.simon@--------->
To:
Date: 9/4/2007 12:27:00 PM
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/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent