我生成的 XML 标记如下 -
<P_MONTH>01</P_MONTH>
-<G_1>
<DIVISION>CA Division</DIVISION>
<DISTRICT>CA District</DISTRICT>
<DEPARTMENT>Global Operations</DEPARTMENT>
<DEP_EMPL_COUNT>9</DEP_EMPL_COUNT>
</G_1>
-<G_1>
<DIVISION>CA Division</DIVISION>
<DISTRICT>CA District</DISTRICT>
<DEPARTMENT>Laboratory Services</DEPARTMENT>
<DEP_EMPL_COUNT>11</DEP_EMPL_COUNT>
</G_1>
-<G_1>
<DIVISION>CA Division</DIVISION>
<DISTRICT>CA District</DISTRICT>
<DEPARTMENT>Corporate</DEPARTMENT>
<DEP_EMPL_COUNT>3</DEP_EMPL_COUNT>
</G_1>
-<G_1>
<DIVISION>CA Division</DIVISION>
<DISTRICT>S District</DISTRICT>
<DEPARTMENT>Corporate Administration</DEPARTMENT>
<DEP_EMPL_COUNT>6</DEP_EMPL_COUNT>
</G_1>
-<G_1>
<DIVISION>CA Division</DIVISION>
<DISTRICT>S District</DISTRICT>
<DEPARTMENT>Corporate Technology</DEPARTMENT>
<DEP_EMPL_COUNT>1</DEP_EMPL_COUNT>
</G_1>
当我在 RTF 模板中使用如下标签时-
DIVISION DISTRICT DEPARTMENT COUNT
<?for-each:G_1?> <DIVISION> <DISTRICT> <DEPARTMENT> <COUNT> <?end for-each?>
这给出了类似的输出 -
DIVISION DISTRICT DEPARTMENT COUNT
CA Division CA District Global Operations 9
CA Division CA District Laboratory Services 11
CA Division CA District Corporate 3
CA Division S District Corporate Administration 6
CA Division S District Corporate Technology 1
我希望抑制部门和地区中的重复值,并且输出看起来像 -
DIVISION DISTRICT DEPARTMENT COUNT
CA Division CA District Global Operations 9
Laboratory Services 11
Corporate 3
S District Corporate Administration 6
Corporate Technology 1
如何实现?我无法正确使用 for-each-group 对标签进行分组。有人可以帮忙吗?