A-Z list links (qid=1328351 cont.)
A-Z list links (qid=1328351 cont.)
(OP)
Hi
After a long search I found thread 1328351 but it's closed. As k5tm is still active here, I hope he sees this or maybe somebody else can reply.
I integrated the last reply (7 Feb 07 11:28) into my xslt and get it to run without complaints. As I am a beginner I now should find out which part of his code to replace with my field name.
"My" original sort select was:
<xsl:sort select="translate(normalize-space(translation/translations/entry/value),'abcdefghijklmnopqrstuvwxyzäöüéèàç','ABCDEFGHIJKLMNOPQRSTUVWXYZAOUEEAC')"/>
But the sort still works when I shorten it to
<xsl:sort select="translation/translations/entry/value"/>
which is what the name field is called in the XML file.
It's normal text, A-Z, what I would like to do is insert a jump navigation so I can navigate to a certain letter in the alphabet, which would be the first letter of translation/translations/entry/value.
---
I will copy k5tm's reply below - my question is: where do I have to replace his "name" with my "translation/translations/entry/value"?
If there is a simpler solution by now I'm not at all against it!
Thank you

RE: A-Z list links (qid=1328351 cont.)
CODE -->
RE: A-Z list links (qid=1328351 cont.)
Tom Morrison
Micro Focus
RE: A-Z list links (qid=1328351 cont.)
"But the sort still works when I shorten it..." is not true, it has to be normalized to sort correctly.
This is the output without the A-Z navigation: swissbib.ch/libraries.
RE: A-Z list links (qid=1328351 cont.)
RE: A-Z list links (qid=1328351 cont.)
And I am slightly confused about exactly what you are asking. If you are asking about the navigation links, the following code lines are used to create the link line, followed by an anchor tag for the letter being started:
CODE
Tom Morrison
Micro Focus
RE: A-Z list links (qid=1328351 cont.)
Which part of your code I have to replace with my sort select. I'll copy the XML + XSLT below, but I'm out of office until next Thursday and offline from tomorrow until Wednesday.
Thank you for taking the time to look into this :)
RE: A-Z list links (qid=1328351 cont.)
XML:
CODE -->
RE: A-Z list links (qid=1328351 cont.)
CODE -->
RE: A-Z list links (qid=1328351 cont.)
RE: A-Z list links (qid=1328351 cont.)
CODE -->
RE: A-Z list links (qid=1328351 cont.)
Yor XSLT has exactly one sort in it, so lets look at it.
CODE -->
The xsl:for-each is going to iterate over the set of <library> nodes. The problem you may be having is that there are multiple translation/translations/entry/value nodes subordinate to each <library> node. Which one do you want to use for determining the sort order? Perhaps you would like to use the one whose language is 'de' rather than the first <value>, in which case you might want to use an XPath expression such as:
CODE
Or maybe I am still not understanding what you are asking...
Tom Morrison
Micro Focus
RE: A-Z list links (qid=1328351 cont.)
I thought this was what thread 1328351 was solving but maybe I got that wrong?
RE: A-Z list links (qid=1328351 cont.)
And I understand now what I need to show you. Unfortunately, Thursday is my busiest day, especially in the morning (USA time).
I will return - probably today - with your solution.
Tom Morrison
Micro Focus
RE: A-Z list links (qid=1328351 cont.)
RE: A-Z list links (qid=1328351 cont.)
I moved the formatting of an individual library into a called template, so that the link generation logic is more obvious.
I would suggest also that you use the xsl:output mechanism for output of the DOCTYPE declaration. I have chosen HTML 4.01 strict for the DOCTYPE; adjust as you see fit.
My technique outputs navigation links only for those letters that actually appear in the data. If you want a list of all letters, then a slightly different technique will be needed, and you need to decide whether there will be href values for all the letters, or whether only those letters that exist in the data will have href values.
Let me know how this works for you...
CODE --> XSLT
Tom Morrison
Micro Focus
RE: A-Z list links (qid=1328351 cont.)
Copying the code here had turned ..."translate(road,'"','')" to ..."translate(road,'"','')"
but I can't see a way to edit a post.
I added a <br /> after <xsl:template name="genLinks">, now it looks great. Will be online soon.
I think all the keywords are covered, so others also have a chance of finding this.
Thank you again, this is exactly what I was looking for.
RE: A-Z list links (qid=1328351 cont.)
And, by the way, welcome to Tek-Tips!
Tom Morrison
Micro Focus
RE: A-Z list links (qid=1328351 cont.)
&quot;
inside the code box.
Here is an attempt:
CODE --> XML
It works on the preview. Pressing Submit Post button...
Tom Morrison
Micro Focus
RE: A-Z list links (qid=1328351 cont.)
Thank you. I'm glad i found it.
> I am on the 'advisory board'
Could you advise them to introduce an edit button?
RE: A-Z list links (qid=1328351 cont.)
That is on the list of desired features. Not too close to the top of the list, though.
Tom Morrison
Micro Focus