How do I add conditions to xslt?
How do I check TimeStampChange node is the only node with Op code
AND in CaseEvent there are no Op codes on any other child nodes? i.e. CaseEvent\TimeStampChange Op="E" and there are no Op codes on any other child elements.
If statement will be true when TimeStampChange is the only node in CaseEvent that have Op code. If any other node have an Op code, then the If statement will be False
Here is the xml that I am reading
<Case>
<CaseEvent Op="E">
<RevDate Op="E">08/01/2019</RevDate>
<CompDate Op="E">08/01/2019</CompDate>
<TimestampChange Op="E">08/01/2019 14:07:15:690</TimestampChange>
</CaseEvent>
</Case>
Here is my xslt code. I need help adding and condition to also check if any other child nodes in CaseEvent have Op code. The XML above should return false because TimeStampChange has @Op and also CompDate has @Op.
<xsl:if test="(@Op='E') and (((CompDate[@Op='A']) or (CompDate[@Op='E'])) or (TimestampChange[@Op='E'] and count(*[@Op])=1))">True</xsl:if>
Last edited by winkimjr2; August 8th, 2019 at 11:42 PM..
Reason: Added my if statement
|