[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XSLT logic problem

Subject: XSLT logic problem
From: Siddharth Jain <sidjain81@xxxxxxxxx>
Date: Mon, 8 Nov 2004 14:36:13 +0530
logic problem
Hi,
I am a novice in XSLT and have a problem.

I have a XML of the following kind which i recieve from the database.
<ROWSET>
<ROW num="1">
     <CORE_ID>Core 1</CORE_ID>
     <CORE_EFF_START_DT>04-SEP-2004</CORE_EFF_START_DT>
     <CORE_EFF_END_DT>31-DEC-2050</CORE_EFF_END_DT>
     <MPN_CD>Device 1</MPN_CD>
     <MPN_DESC>Device 1 description</MPN_DESC>
     <MPN_EFF_START_DT>04-SEP-2004</MPN_EFF_START_DT>
     <MPN_EFF_END_DT>31-DEC-2050</MPN_EFF_END_DT>
  </ROW>
  <ROW num="2">
     <CORE_ID>Core 1</CORE_ID>
     <CORE_EFF_START_DT>04-SEP-2004</CORE_EFF_START_DT>
     <CORE_EFF_END_DT>31-DEC-2050</CORE_EFF_END_DT>
     <MPN_CD>Device 2</MPN_CD>
     <MPN_DESC>Device 2 description</MPN_DESC>
     <MPN_EFF_START_DT>24-SEP-2004</MPN_EFF_START_DT>
     <MPN_EFF_END_DT>31-DEC-2050</MPN_EFF_END_DT>
  </ROW>
 <ROW num="3">
     <CORE_ID>Core 2</CORE_ID>
     <CORE_EFF_START_DT>04-SEP-2004</CORE_EFF_START_DT>
     <CORE_EFF_END_DT>31-DEC-2050</CORE_EFF_END_DT>
     <MPN_CD>Device 1</MPN_CD>
     <MPN_DESC>Device 1 description</MPN_DESC>
     <MPN_EFF_START_DT>12-OCT-2004</MPN_EFF_START_DT>
     <MPN_EFF_END_DT>31-DEC-2050</MPN_EFF_END_DT>
  </ROW>
</ROWSET>

The CORE_ID is associated to a core product and MPN_CD is associated
to a device product.
Also,
1. One core product can have many device products. (i needed a
hierarchy where all device products associated to a single core
product were displayed together. I took care of this using grouping)
2. One device product can be in more than one core product.

The condition is as follows:
For a device product,
if MPN_EFF_END_DT < CurrentDate  => inactive
else                                                 => active

So a device product can be active/inactive. It could be active under
one core product and inactive under another core product.

What is required:  If in a case where one device product occurs in
more than one core product and in one of the cases the device product
is found to be inactive, then that device product should not be
displayed instead only the active ones under other core products
should be displayed.
Moreover, if in a case, where one device product occurs in more than
one core product and in all of these the device product is found to be
inactive, then the device product should be displayed.

Please help me out with a logic as to how should i go about
implementing this. If anyone can give me a sample code that will be
the best.

Thanks & Regards,
Siddharth.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.