XSL1.0里怎么分组count?
XML文件如下:
- XML code
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="count-group.xsl"?><errorList> <problem> <severity>Critical</severity> <dir>a</dir> </problem> <problem> <severity>Severe</severity> <dir>b</dir> </problem> <problem> <severity>Error</severity> <dir>b</dir> </problem> <problem> <severity>Severe</severity> <dir>c</dir> </problem> <problem> <severity>Critical</severity> <dir>a</dir> </problem></errorList>
想要的结果:
- XML code
Dir Critical Severe Errora 2 b 1c 1
其中Dir的内容是可变的,应该怎么写XSL?
不要用XSL2.0
[解决办法]
呵呵 不会 向你学习
[解决办法]
交叉表这种逻辑,恐怕2.0也不见得好做。
倒是建议用程序来处理,如脚本(包括XSLT内嵌脚本)等。
XSLT的功能还是做格式转换的,在逻辑处理上是它的弱项,要搭配内嵌脚本处理才行。