Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 5th, 2019, 11:41 AM
Friend of Wrox
Points: 465, Level: 7
Points: 465, Level: 7 Points: 465, Level: 7 Points: 465, Level: 7
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Apr 2013
Posts: 101
Thanks: 14
Thanked 0 Times in 0 Posts
Default 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
Reply With Quote
  #2 (permalink)  
Old August 9th, 2019, 08:15 AM
Friend of Wrox
Points: 465, Level: 7
Points: 465, Level: 7 Points: 465, Level: 7 Points: 465, Level: 7
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Apr 2013
Posts: 101
Thanks: 14
Thanked 0 Times in 0 Posts
Default Delete question

I do not need help on this one
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy with conditions scubin XSLT 1 November 30th, 2009 07:04 PM
SQL LIKE Multiple Conditions takwirira ASP.NET 2.0 Basics 1 April 16th, 2008 06:24 AM
Multiple conditions austinf XSLT 1 May 5th, 2006 02:55 AM
Multiple conditions austinf XSLT 1 May 5th, 2006 02:38 AM
Conditions in looping sridevi XSLT 0 July 31st, 2004 06:11 AM



All times are GMT -4. The time now is 12:46 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.