How to sort bibliography by language

Jun 17, 2009 at 2:39 PM

I mean, by default Word put literature with english named author first (if we sort by author in style, of course), and my native language named author after. And I need to put it in reverse.

Is there a way to do this?

Thx in advance)

Coordinator
Jun 17, 2009 at 4:55 PM

I don't really understand what you try to achieve. Maybe you could try providing an example bibliography with 3 or 4 entries to illustrate your question.

Both the predefined styles and the BibWord styles offered here use a 'key' string to sort entries. How that key is generated is entirely up to you.

Jun 17, 2009 at 6:23 PM
Edited Jun 17, 2009 at 10:06 PM

And 'key' consist of symbols. And who decides that letter 'b' should be before 'a' and integers: '1','2', etc. should be before all letters?

Is there a way to change string comparison method?

Example, that u ask:

I have in bibliography:

1. Xiaozhan Xu The SIR method: A superiority and inferiority ranking method for multiple criteria decision making // European Journal of Operational Research. - 2001. - № 131 - с. 587-602.
2. Zopounidis C. Multicriteria decision aid in financial management // European Journal of Operational Research. - 1999. - № 119 - с. 404-415.
3. Айвазян С.А., Бухштабер В.М., Енюков И.С., Мешалкин Л.Д. Прикладная статистика / Классификация и снижение размерности. -М.: Финансы и статистика- 1989.
4. Айвазян С.А., Мхитарян В.С. Прикладная статистика и основы эконометрики. -М.: Юнити- 1998.

I need:

1. Айвазян С.А., Бухштабер В.М., Енюков И.С., Мешалкин Л.Д. Прикладная статистика / Классификация и снижение размерности. -М.: Финансы и статистика- 1989.
2. Айвазян С.А., Мхитарян В.С. Прикладная статистика и основы эконометрики. -М.: Юнити- 1998.
3. Xiaozhan Xu The SIR method: A superiority and inferiority ranking method for multiple criteria decision making // European Journal of Operational Research. - 2001. - № 131 - с. 587-602.
4. Zopounidis C. Multicriteria decision aid in financial management // European Journal of Operational Research. - 1999. - № 119 - с. 404-415.

 I think it's very ease to achieve, just i don't understand bibword completely and don't have much time for it ((

Coordinator
Jun 17, 2009 at 7:25 PM

The "lang" attribute of the "xsl:sort" element (http://www.w3.org/TR/xslt#sorting) decides on the sorting algorithm. The implementation of the sorting algorithm should be the same for every XSL engine and has nothing to do with any Word bibliography style implementation. If no attribute is given, then the default language is assumed (that holds for BibWord).

But I'm not sure if the Microsoft engine (or any other XSL engine for that matter) has support for sorting using multiple languages/character sets as you want to do.

Without having time to test it, two ideas come to mind:

  1. Play around with the encoding parameter to see if you can find a common factor for latin and cyrillic.
  2. Write a small replace routine in XSL which converts cyrillic characters to their latin counterparts and then do an ordinary sorting based on the converted string.

As I'm not a specialist when it comes to different languages and encodings, the second one sounds like the option guaranteed to give a solution. It's also the solution requiring most work.

Jun 17, 2009 at 10:09 PM
Edited Jun 17, 2009 at 10:18 PM

Choosing option 2, where i should put my procedure?

I tried to add it where <b:SortKey> is created. Like this :

                <xsl:call-template name="cyrillic_before_english">
                  <xsl:with-param name="string">
                
                <xsl:call-template name="upper-case">
                  <xsl:with-param name="string">
                    <xsl:call-template name="format-source">
                      <xsl:with-param name="format" select="msxsl:node-set($data)/bibliography/source[@type = $type]/sortkey" />
                      <xsl:with-param name="source" select="." />
                    </xsl:call-template>
                  </xsl:with-param>
                </xsl:call-template>

                  </xsl:with-param>
                </xsl:call-template>

But got no result. Maybe u can give me another tip)

 

Jun 17, 2009 at 10:24 PM
Edited Jun 17, 2009 at 10:38 PM

Ok. I got it to work.

The problem was in procedure itself, not in the place where it's called.

Actually I never even heard about xsl before yesterday, so the only thing i can do is 32 statements for each alphabet letter:

 

    <xsl:if test="contains(substring($string, 2, 1),'А')">
      <xsl:text>0</xsl:text>
    </xsl:if>

 

 Is there a way to do it in one line?

 

Jun 17, 2009 at 10:32 PM
Edited Jun 17, 2009 at 10:32 PM

And another problem appears.

Though i get the right bibliography now, BibWordExtender doesn't update citations and numbers in file properly (((((

Coordinator
Jun 17, 2009 at 10:48 PM

You could reverse your contains operation as "substring($string, 2, 1)" returns only a single character. So you can check that single character against your entire alphabet. So something along:

contains('ABCDEFGHI...', substring($string, 2, 1))

The Extender uses the same sortkey but calculates its output in a different place. So you have to add the change twice. Once in "format-bibliography" (which you probalby did) and once in "bibword-extensions".

 

Jun 17, 2009 at 11:35 PM
Edited Jun 18, 2009 at 12:33 AM

Oh, yes! It became much shorter)

And I have already guessed about second change by myself.

So, thank you for all the help. And for working for such usefull thing)

Also, can I add my style to the collection? Mb it'll help someone.

Coordinator
Jun 18, 2009 at 11:46 PM

If you mail it to me, I'll check it and provide a release page for it. Also provide a short description and a way to identify you (author name or something) so I can give appropriate credit.

Aug 27, 2011 at 3:12 PM

Please, post your solution here - I have the same problem, but I'm sure I won't be able to code anything by myself. You help will be really appreciated!