IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

How do I add condition to if statement? Options · View
winkimjr2
Posted: Wednesday, August 7, 2019 10:33:36 PM
Rank: Member

Joined: 5/26/2016
Posts: 19
Location: Maplewood USA
I want to check if CompDate has an Op code =E or A
OR if TimeStampChange node is the only node with Op code =E
AND if 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=E
If statement will also be true if CompDate Op code =E or A but when TimeStampChange has no Op code.

Here is the xml that I am reading

<CaseEvent Op="E">
<EventDate>08/06/2019</EventDate>
<Comment Op="E">no rain</Comment>
<Deleted>false</Deleted>
<RevDate Op="E">08/08/2020</RevDate>
<CompDate Op="E">08/06/2019</CompDate>
<TimestampChange Op="E">08/06/2019 07:11:28:317</TimestampChange>
<EventType Word="NOPERWELL">Personal</EventType>
</CaseEvent>


Here is my xslt code. I need help adding and condition to check if any other child nodes in CaseEvent have Op code

<xsl:if test="(@Op='E') and ((EventType/@Word='NOPERWELL') or (EventType/@Word='NORIGHTS')) and ((CompDate[@Op='A']) or (CompDate[@Op='E']) or ((TimestampChange[@Op='E']) and (//CaseEvent[not(@Op)]/*)))">
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.