这是我的问题:
我有一个这样的 XMLReader:
root: "response>claims",
row: "claim",
repeatitems: false,
id: "claimId"
和这样的 XML 数据结构:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response>
<claims>
<claim>
<actions />
<adjusters />
<claimId>254</claimId>
<parties />
<claimSubmitInd>N</claimSubmitInd>
<claimTypeCd>AUTO</claimTypeCd>
<units>
<unit>
<claimId>254</claimId>
<insertId>sselvaraj</insertId>
<insertTmstmp>2012-10-24 18:07:47.167</insertTmstmp>
<roleCategory>veh_1st</roleCategory>
<sourceSystemCd>FNOL</sourceSystemCd>
<unitCategory>veh</unitCategory>
<coverages />
<damages />
<unitDataType>veh</unitDataType>
<unitId>1</unitId>
<unitSubType>sch</unitSubType>
<unitType>veh</unitType>
<updateId>sselvaraj</updateId>
<updateTmstmp>2012-10-24 18:07:47.167</updateTmstmp>
</unit>
<unit>
<claimId>254</claimId>
<insertId>sselvaraj</insertId>
<insertTmstmp>2012-10-24 18:14:07.437</insertTmstmp>
<roleCategory>veh_1st</roleCategory>
<sourceSystemCd>FNOL</sourceSystemCd>
<unitCategory>veh</unitCategory>
<coverages />
<damages />
<unitDataType>veh</unitDataType>
<unitId>2</unitId>
<unitSubType>sch</unitSubType>
<unitType>veh</unitType>
<updateId>sselvaraj</updateId>
<updateTmstmp>2012-10-24 18:14:07.437</updateTmstmp>
</unit>
<unit>
<claimId>254</claimId>
<insertId>sselvaraj</insertId>
<insertTmstmp>2012-10-24 18:17:47.597</insertTmstmp>
<roleCategory>veh_1st</roleCategory>
<sourceSystemCd>FNOL</sourceSystemCd>
<unitCategory>veh</unitCategory>
<coverages />
<damages />
<unitDataType>veh</unitDataType>
<unitId>3</unitId>
<unitSubType>sch</unitSubType>
<unitType>veh</unitType>
<updateId>sselvaraj</updateId>
<updateTmstmp>2012-10-24 18:17:47.597</updateTmstmp>
</unit>
</units>
<clmAdjUserId>0</clmAdjUserId>
<companyCd>06</companyCd>
<injuryInd>N</injuryInd>
<insInjAsPasInd>N</insInjAsPasInd>
<insInjAsPedInd>N</insInjAsPedInd>
<keyedDt>2012-10-24</keyedDt>
<lossTmUnkInd>N</lossTmUnkInd>
<othPropDmgInd>N</othPropDmgInd>
<polFireAtSceneInd>N</polFireAtSceneInd>
<rptOnlyInd>N</rptOnlyInd>
<towClaimInd>N</towClaimInd>
<witnessInd>N</witnessInd>
</claim>
</claims>
<request>
<expand>claim,units</expand>
<filter>claimId eq 254</filter>
<format>xml</format>
<orderBy>claimId desc</orderBy>
<orderByCol>claimId</orderByCol>
<orderByDir>desc</orderByDir>
<top>10</top>
</request>
</response>
如果我的列是这样定义的:
colModel: [
{
name: "claimId",
index: "claimId",
width: 20,
xmlmap: ">claimId",
align: "right",
sorttype: 'int',
hidden: false,
searchoptions: {
sopt: soptnums,
attr: {style: "text-align: right;"}
}
}
,{
name: "unitId",
index: "unitId",
width: 20,
xmlmap: "units>unit>unitId",
align: "center",
sorttype: 'int',
hidden: false,
searchoptions: {
sopt: soptnums,
attr: {style: "text-align: center;"}
}
}
然后我看到声明 id 节点值很好,并且单元集合中 unitId 节点值的所有对应匹配项的串联。
所以,我看到类似的东西
Claim Id Unit Id
254 123
我的问题是:如何为 UnitId xmlmap 编写选择器,以便连接产生像“1|2|3”或“1 separator 2 separator 3”这样的字符串?我尝试了几件事,例如,我看到 xmlmap: "units>unit>unitId:first" 只显示 1(第一个匹配的节点)。
先感谢您。