问题有多个方面:
- 如何根据标签的特定空格分隔内容进行分类
- 缺少此类具体内容如何分类。
以以下数据为例:
<messages>
<m>
<subject>message tagged with A B C</subject>
<tags>A B C</tags>
</m>
<m>
<subject>message tagged with B C D</subject>
<tags>B C D</tags>
</m>
<m>
<subject>message tagged with X Y A</subject>
<tags>X Y A</tags>
</m>
<m>
<subject>message tagged with C X</subject>
<tags>C X</tags>
</m>
<m>
<subject>message tagged with Y</subject>
<tags>Y</tags>
</m>
</messages>
给定一组已知的标签,比如说
<xsl:param name="pKnownTags">
<t>A</t>
<t>B</t>
</xsl:param>
我想生成一个如下所示的输出:
Messages tagged with A:
* message tagged with A B C
* message tagged with X Y A
Messages tagged with B:
* message tagged with A B C
* message tagged with B C D
Messages tagged with neither:
* message tagged with C X
* message tagged with Y
使用 EXSLT 很好,否则需要 1.0 解决方案。这可能吗?