How do I add conditions to XSLT if statement
Posted: Wed Aug 07, 2019 4:45 pm
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
Here is my xslt code. I need help adding and condition to also check if any other child nodes in CaseEvent have 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
Code: Select all
<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>
Code: Select all
<xsl:if test="((TimestampChange[@Op='E']) and ())">True</xsl:if>