I am new to XSLT and am trying to solve the following transformation.
I have an XML that looks like this...
<Groups>
<Group>
<GroupSelector>52</GroupSelector>
<GroupDescription>Group 52</GroupDescription>
<GroupValue>ABCD</GroupValue>
</Group>
<Group>
<GroupSelector>27</GroupSelector>
<GroupDescription>Group 27</GroupDescription>
<GroupValue>PQRS</GroupValue>
</Group>
<Group>
<GroupSelector>20</GroupSelector>
<GroupDescription>Group 20</GroupDescription>
<GroupValue>XYZA</GroupValue>
</Group>
<Group>
<GroupSelector>15</GroupSelector>
<GroupDescription>Group 15</GroupDescription>
<GroupValue>MNOP</GroupValue>
</Group>
</Groups>
There may be 0 to n number of 'Group's
I am trying to apply an XSLT to find a 'Group' where 'GroupSelector' value is 20 and create output like this;
<GroupSelection ElementName="FoundGroup" Missing="false">20</GroupSelection>
<GroupSelection ElementName="GroupDes" Missing="false">Group 20</GroupSelection>
<GroupSelection ElementName="GroupVal" Missing="false">XYZA</GroupSelection>
If none of the n 'Group's have a 'GroupSelector' with value 20, the output should be as such;
<GroupSelection ElementName="FoundGroup" Missing="true"/>
<GroupSelection ElementName="GroupDes" Missing="true"/>
<GroupSelection ElementName="GroupVal" Missing="true"/>
Please help. Thanks in advance.
Lola