I have an XML which looks like
<?xml version="1.0" encoding="UTF-8"?><Rowsets >
<Rowset>
<Row>
<plant>1000</plant>
<workCenterId>10001</workCenterId>
<workCenter>WC1</workCenter>
<alerts>alerts</alerts>
<incident>incident</incident>
<dashboard>dashboard</dashboard>
<alertStatus>false</alertStatus>
<incidentStatus>false</incidentStatus>
<dashboardStatus>true</dashboardStatus>
</Row>
<Row>
<plant>1000</plant>
<workCenterId>10001</workCenterId>
<workCenter>WC1</workCenter>
<alerts>alerts</alerts>
<incident>incident</incident>
<dashboard>dashboard</dashboard>
<alertStatus>true</alertStatus>
<incidentStatus>false</incidentStatus>
<dashboardStatus>false</dashboardStatus>
</Row>
<Row>
<plant>1000</plant>
<workCenterId>10001</workCenterId>
<workCenter>WC1</workCenter>
<alerts>alerts</alerts>
<incident>incident</incident>
<dashboard>dashboard</dashboard>
<alertStatus>false</alertStatus>
<incidentStatus>true</incidentStatus>
<dashboardStatus>false</dashboardStatus>
</Row>
<Row>
<plant>1000</plant>
<workCenterId>10002</workCenterId>
<workCenter>WC2</workCenter>
<alerts>alerts</alerts>
<incident>incident</incident>
<dashboard>dashboard</dashboard>
<alertStatus>false</alertStatus>
<incidentStatus>false</incidentStatus>
<dashboardStatus>true</dashboardStatus>
</Row>
<Row>
<plant>1000</plant>
<workCenterId>10002</workCenterId>
<workCenter>WC2</workCenter>
<alerts>alerts</alerts>
<incident>incident</incident>
<dashboard>dashboard</dashboard>
<alertStatus>true</alertStatus>
<incidentStatus>false</incidentStatus>
<dashboardStatus>false</dashboardStatus>
</Row>
<Row>
<plant>1000</plant>
<workCenterId>10003</workCenterId>
<workCenter>WC3</workCenter>
<alerts>alerts</alerts>
<incident>incident</incident>
<dashboard>dashboard</dashboard>
<alertStatus>false</alertStatus>
<incidentStatus>false</incidentStatus>
<dashboardStatus>false</dashboardStatus>
</Row>
<Row>
<plant>1000</plant>
<workCenterId>10004</workCenterId>
<workCenter>WC4</workCenter>
<alerts>alerts</alerts>
<incident>incident</incident>
<dashboard>dashboard</dashboard>
<alertStatus>false</alertStatus>
<incidentStatus>false</incidentStatus>
<dashboardStatus>false</dashboardStatus>
</Row>
<Row>
<plant>1000</plant>
<workCenterId>10005</workCenterId>
<workCenter>WC4</workCenter>
<alerts>alerts</alerts>
<incident>incident</incident>
<dashboard>dashboard</dashboard>
<alertStatus>false</alertStatus>
<incidentStatus>false</incidentStatus>
<dashboardStatus>false</dashboardStatus>
</Row>
</Rowset>
What i wish to do is iterate through each Workcenter and and extract the text value "true" wherever it is true.in the next iteration if workCenter is same again extract the text "true" and so on.
I am new to XSLT, no idea on sibling node. Can someone help?
Expected output after all iteration`
<?xml version="1.0" encoding="UTF-8"?>
<root>
<WC>
<workCenter>WC1</workCenter>>
<alerts>alerts:true</alerts>
<dashboard>dashboard:true</dashboard>
<incident>incident:true</incident>
</WC>
<WC>
<workCenter>WC2</workCenter>>
<alerts>alerts:true</alerts>
<dashboard>dashboard:true</dashboard>
<incident>incident:false</incident>
</WC>
<WC>
<workCenter>WC3</workCenter>>
<alerts>alerts:false</alerts>
<dashboard>dashboard:false</dashboard>
<incident>incident:false</incident>
</WC>
<WC>
<workCenter>WC4</workCenter>>
<alerts>alerts:false</alerts>
<dashboard>dashboard:false</dashboard>
<incident>incident:false</incident>
</WC>
</root>
This is handled at the backend SQL DB