[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|