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

Multiple Filtering of rows based on attributes values

Subject: Multiple Filtering of rows based on attributes values
From: "Kamlesh Bafna" <Kamlesh.Bafna@xxxxxxxx>
Date: Fri, 15 May 2009 11:44:44 +0530
 Multiple Filtering of rows based on attributes values
Hi,

I have the following input xml.
My requirement is -
1. Select all row with ItemCode - 'PENEMR' & then get thier PROD_DEPT_ID
2.  For each PROD_DEPT_ID found above - Check atleast one row is present
whose Item_Code is ARTPAY and same PROD_DEPT_ID. If not present then add
a new row with ITEM_CODE as ARTPAY and PROD_DEPT_ID value same as
PENEMR.

I am using Microsoft .NET 3.0 xsl processor. I have written an xslt
which loopes through the rows to find the row with ITEM_CODE as PENEMR
and then another loop to identify the ARTPAY. However i think there is
better way to do this through keys and requires some guidance on this.

Also I am unable to find single Xpath to find row with Item Code as
ART_PAY and Pensional as 'Y' and PROD_DEPT_ID as some variable value.
Please help.

Thanks
Kamlesh

INPUT XML -

<Rows>
    <Row>
     <Field alias="ITEM_CODE">NIEMR</Field>
     <Field alias="PENSIONALBE">N</Field>
     <Field alias="PROD_DEPT_ID">Task1</Field>
    </Row>
    <Row>
     <Field alias="ITEM_CODE">NIEME</Field>
     <Field alias="PENSIONALBE">N</Field>
     <Field alias="PROD_DEPT_ID">Task1</Field>
    </Row>
    <Row>
     <Field alias="ITEM_CODE">ARTPAY</Field>
     <Field alias="PENSIONALBE">Y</Field>
     <Field alias="PROD_DEPT_ID">Task2</Field>
    </Row>
    <Row>
     <Field alias="ITEM_CODE">ARTPAY</Field>
     <Field alias="PENSIONALBE">N</Field>
     <Field alias="PROD_DEPT_ID">Task1</Field>
    </Row>
    <Row>
     <Field alias="ITEM_CODE">PENEME</Field>
     <Field alias="PENSIONALBE">N</Field>
     <Field alias="PROD_DEPT_ID">Task1</Field>
    </Row>
    <Row>
     <Field alias="ITEM_CODE">PENEMR</Field>
     <Field alias="PENSIONALBE">N</Field>
     <Field alias="PROD_DEPT_ID">Task1</Field>
    </Row>
    <Row>
     <Field alias="ITEM_CODE">PENEMR</Field>
     <Field alias="PENSIONALBE">N</Field>
     <Field alias="PROD_DEPT_ID">Task2</Field>
    </Row>
    <Row>
     <Field alias="ITEM_CODE">PENEMR</Field>
     <Field alias="PENSIONALBE">N</Field>
     <Field alias="PROD_DEPT_ID">Task3</Field>
    </Row>
    <Row>
     <Field alias="ITEM_CODE">ARTPAY</Field>
     <Field alias="PENSIONALBE">Y</Field>
     <Field alias="PROD_DEPT_ID">Task1</Field>
    </Row>
    <Row>
     <Field alias="ITEM_CODE">ADVREC</Field>
     <Field alias="PENSIONALBE">N</Field>
     <Field alias="PROD_DEPT_ID">Task1</Field>
    </Row>
    <Row>
     <Field alias="ITEM_CODE">VATAMT</Field>
     <Field alias="PENSIONALBE">N</Field>
     <Field alias="PROD_DEPT_ID">Task1</Field>
    </Row>
   </Rows>








The information contained in this communication is intended solely for
the use of the individual or entity to whom it is addressed and others
authorized to receive it.   It may contain confidential or legally
privileged information.   If you are not the intended recipient you are
hereby notified that any disclosure, copying, distribution or taking any
action in reliance on the contents of this information is strictly prohibited
and may be unlawful. If you have received this communication in error,
please notify us immediately by forwarding this email to
MailAdmin@xxxxxxxx and then delete it from your system.

Ness technologies is neither liable for the proper and complete
transmission of the information contained in this communication nor for
any delay in its receipt.

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.