帮助xsl:sort [英] Help with xsl:sort

查看:78
本文介绍了帮助xsl:sort的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好


我正在使用Apache和mod-xslt的以下代码,但它并没有排序

元素为我想要它。目前,它用所有物品对它们进行分类

首先以大写字母开头,如下所示:

ABC abc


无论case-order属性的设置是什么。它看起来好像是用ASCII(或unicode ......?)

字符顺序对它们进行排序,而不是根据语言设置。


lang属性应该从

系统环境中自动推断,但即使是手动设置(到en-GB),

排序仍然没有按预期工作。


根据手册,属性设置为高于第一,它应该做

这个:

一个B b C c

....并且设置为低于先,它应该这样做:

a A b B c C

这里是代码:


< xsl:apply-templates select =" bookmark | alias [name(id(id) @ref))=''书签'']"

mode =" main">

< xsl:sort select =" concat(title, ID(@ref)/标题)" lang =" en-GB" />

< / xsl:apply-templates>


谢谢!


-

我在CAMbridge,而非SPAMbridge

Hi all

I''m using the following code with Apache and mod-xslt but it''s not sorting
the elements as I want it to. At the moment, it sorts them with all items
starting with an uppercase letter first, like this:
A B C a b c

no matter what the setting of the case-order attribute is. It
rather looks like it''s sorting them by ASCII (or unicode..?)
character order, rather than according to the language setting.

The lang attribute should be inferred automatically from the
system environment, but even if it is set manually (to "en-GB"),
the sort still does not work as expected.

According to the manual, with the attribute set to upper-first, it should do
this:
A a B b C c
....and with it set to lower-first, it should do this:
a A b B c C
Here''s the code:

<xsl:apply-templates select="bookmark|alias[name(id(@ref)) = ''bookmark'']"
mode="main">
<xsl:sort select="concat(title,id(@ref)/title)" lang="en-GB"/>
</xsl:apply-templates>

Thanks!

--
I''m at CAMbridge, not SPAMbridge

推荐答案

你有没有理由'我试图用这种语言暗示这个,而不是使用专门用于

目的的case-order属性?

< a rel =nofollowhref =http://www.w3.org/TR/xslt#sortingtarget =_ blank> http://www.w3.org/TR/xslt#sorting


-

()ASCII Ribbon Campaign | Joe Kesselman

/ \标记HTML电子邮件! |系统architexture和动态诗歌
Is there a reason you''re trying to imply this using language, rather
than using the case-order attribute which is specifically intended for
the purpose?

http://www.w3.org/TR/xslt#sorting

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry


Joe Kesselman写道:
Joe Kesselman wrote:

你有没有理由尝试这意味着使用语言,而不是使用专门用于

目的的case-order属性?
Is there a reason you''re trying to imply this using language, rather
than using the case-order attribute which is specifically intended for
the purpose?



对不起,我应该解释得更好。我已经尝试过只用lang,

,只是大小写和两个指定但没有一个与最终的排序顺序产生任何

差异。这是mod-xslt中的一个错误吗?


-

我在CAMbridge,而不是SPAMbridge

Sorry, I should''ve explained better. I''ve tried doing it with just lang,
with just case-order and with both specified but none of it makes any
difference to the final sorting order. Is this a bug in mod-xslt?

--
I''m at CAMbridge, not SPAMbridge


为了澄清,我已尝试使用各种选项进行排序(在
href =http://www.w3 .org / TR / xslt#sorting)target =_ blank> http://www.w3.org/TR/xslt#sorting)
,但无论我做什么

总是对这样的项目进行排序:


ABC abc


根据我的任何定义,这不是正确的排序顺序已经看过了。


我不介意它是否在较低的

案件之前或之后对大件物品进行分类,但我希望它能够排序所有以A开头的项目在以B开头的所有项目之前的

的情况任何一种情况。以下任何一个

都没关系:


A a B b C c

a A b B c C

我希望能让它更清晰一些 - 抱歉,我第一次没有很好地解释




-

我在CAMbridge,而不是SPAMbridge
To clarify, I''ve tried using sort with each of its various options (as
listed on http://www.w3.org/TR/xslt#sorting), but no matter what I do it
always sorts the items like this:

A B C a b c

That''s not a correct sorting order by any definition that I''ve seen.

I don''t really mind whether it sorts upper case items before or after lower
case, but I would like it to sort all items beginning with an "A" of either
case before all items beginning with a "B" of either case. Either of the
following would be fine:

A a B b C c
a A b B c C

I hope that makes it a bit clearer - sorry, I didn''t explain very well the
first time around.

--
I''m at CAMbridge, not SPAMbridge


这篇关于帮助xsl:sort的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆