Hi Aditya!
You can apply template to source document which copies only elements that fit your condition. Thus, unwanted records will be skipped.
Regards, Evgeniy.
Hello Aditya,
Agree with evegniy.From SAP HCI perspective you can use Content Filter which might fit into your requirement instead of writing XSLT to perform the same.
Below example might help you.
Goal is to pull Active employees from India who are permanent.
Condition in Content Filter:
Input XML:
<?xml version="1.0" encoding="UTF-8"?> <EmployeeData> <Record> <PersonID>1000</PersonID> <UserID>31</UserID> <EmployementID>E221</EmployementID> <Status>A</Status> <Country>IND</Country> <Contractor>No</Contractor> </Record> <Record> <PersonID>1001</PersonID> <UserID>32</UserID> <EmployementID>E222</EmployementID> <Status>T</Status> <Country>SGP</Country> </Record> <Record> <PersonID>1002</PersonID> <UserID>33</UserID> <EmployementID>E223</EmployementID> <Status>A</Status> <Country>CAN</Country> </Record> <Record> <PersonID>C1003</PersonID> <UserID>C34</UserID> <EmployementID>C224</EmployementID> <Status>A</Status> <Country>IND</Country> <Contractor>Yes</Contractor> </Record> </EmployeeData>
Output XML:
<Record> <PersonID>1000</PersonID> <UserID>31</UserID> <EmployementID>E221</EmployementID> <Status>A</Status> <Country>IND</Country> <Contractor>No</Contractor> </Record>
You can have Content Modifier after Content Filter and rebuild the XML with root node [ Having EmployeeData as root node ]
Regards,
Sriprasad Shivaram Bhat
Add comment