Pick XMl from list of XMLS which matching subelements tag values
-
Re: Pick XMl from list of XMLs based on the matching conditions
Sorry Pls use below formatted details <ns:name> <ns:location>asfsafs</ns:location> <ns:locationevent>yyyy</ns:locationevent> <ns:locations> <ns:location1> <ns:locationphase> <ns:Action> <ns:name>Prior</ns:name> </ns:Action> <ns:Status>Completed</ns:Status> </ns:locationphase> </ns:location1> <ns:location1> <ns:locationphase> <ns:Action> <ns:name>Current</ns:name> </ns:Action> <ns:Status>Completed</ns:Status> </ns:locationphase> </ns:location1> <ns:location1> <ns:locationphase> <ns:Action> <ns:name>Future</ns:name> </ns:Action> <ns:Status>Pending</ns:Status> </ns:locationphase> </ns:location1> </ns:locations> <ns:Action> <ns:name>abc</ns:name> </ns:Action> <ns:Action> <ns:name>def</ns:name> </ns:Action> <ID>125</ID> <ns:Coverage> <ns:Action> <ns:name>deg</ns:name> </ns:Action> <ns:Action> <ns:name>def</ns:name> </ns:Action> </ns:Coverage> </ns:name> <ns:name> <ns:location>asfsafs</ns:location> <ns:locationevent>yyyy</ns:locationevent> <ns:locations> <ns:location1> <ns:locationphase> <ns:Action> <ns:name>Prior</ns:name> </ns:Action> <ns:Status>Completed</ns:Status> </ns:locationphase> </ns:location1> <ns:location1> <ns:locationphase> <ns:Action> <ns:name>Current</ns:name> </ns:Action> <ns:Status>Completed</ns:Status> </ns:locationphase> </ns:location1> <ns:location1> <ns:locationphase> <ns:Action> <ns:name>Future</ns:name> </ns:Action> <ns:Status>Pending</ns:Status> </ns:locationphase> </ns:location1> </ns:locations> <ns:Action> <ns:name>abc</ns:name> </ns:Action> <ns:Action> <ns:name>def</ns:name> </ns:Action> <ID>1234ID> <ns:Coverage> <ns:Action> <ns:name>deg</ns:name> </ns:Action> <ns:Action> <ns:name>def</ns:name> </ns:Action> </ns:Coverage> </ns:name> <ns:name> <ns:location>asfsafs</ns:location> <ns:locationevent>yyyy</ns:locationevent> <ns:locations> <ns:location1> <ns:locationphase> <ns:Action> <ns:name>Prior</ns:name> </ns:Action> <ns:Status>Completed</ns:Status> </ns:locationphase> </ns:location1> <ns:location1> <ns:locationphase> <ns:Action> <ns:name>Current</ns:name> </ns:Action> <ns:Status>Completed</ns:Status> </ns:locationphase> </ns:location1> <ns:location1> <ns:locationphase> <ns:Action> <ns:name>Future</ns:name> </ns:Action> <ns:Status>Pending</ns:Status> </ns:locationphase> </ns:location1> </ns:locations> <ns:Action> <ns:name>abc</ns:name> </ns:Action> <ns:Action> <ns:name>def</ns:name> </ns:Action> <ID>123</ID> <ns:Coverage> <ns:Action> <ns:name>deg</ns:name> </ns:Action> <ns:Action> <ns:name>def</ns:name> </ns:Action> </ns:Coverage> </ns:name> I need only the whole XML which matches the following conditions. Condition 1: <ns:name>…<ns:locationevent>yyyy</ns:locationevent> Condition 2: <ns:name>…<ns:Action> <ns:name>def</ns:name> </ns:Action> – May have more than one action with name with other values Condition 3: <ns:name>…<ns:Action> <ns:ID>123</ns:ID> </ns:Action>
-
If you have additional information for a given question, add a reply to that question, rather than opening a new one