我的问题:如何应用双重(或多重)分组?
这是源 XML:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<root>
<row>
<Type>1</Type>
<WeaNr>100519</WeaNr>
</row>
<row>
<Type>2</Type>
<WeaNr>100519</WeaNr>
<ETADC_SKU>2007925</ETADC_SKU>
<CrossDock>N</CrossDock>
</row>
<row>
<Type>2</Type>
<WeaNr>100519</WeaNr>
<ETADC_SKU>12007925</ETADC_SKU>
<CrossDock>N</CrossDock>
</row>
<row>
<Type>2</Type>
<WeaNr>100519</WeaNr>
<ETADC_SKU>200792ww5</ETADC_SKU>
<CrossDock>Y</CrossDock>
</row>
<row>
<Type>1</Type>
<WeaNr>100520</WeaNr>
</row>
<row>
<Type>2</Type>
<WeaNr>100520</WeaNr>
<ETADC_SKU>2007925444</ETADC_SKU>
<CrossDock>N</CrossDock>
</row>
<row>
<Type>2</Type>
<WeaNr>100520</WeaNr>
<ETADC_SKU>2007925333</ETADC_SKU>
<CrossDock>Y</CrossDock>
</row>
<row>
<Type>2</Type>
<WeaNr>100520</WeaNr>
<ETADC_SKU>204445333</ETADC_SKU>
<CrossDock>Y</CrossDock>
</row>
</root>
我想使用分组WeaNr
和CrossDock
这种情况下的预期结果是 4 组:
1. WeaNr=100519 and CrossDock=N
2. WeaNr=100519 and CrossDock=Y
3. WeaNr=100520 and CrossDock=N
4. WeaNr=100520 and CrossDock=Y
只按一个字段分组,比如 WeaNr 很容易:
<xsl:for-each-group select="row" group-by="WeaNr">
那么如何应用双重(或多重)分组?