<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Filtering records based on Xpath expression in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/filtering-records-based-on-xpath-expression/qaa-p/12638700#M4741146</link>
    <description>&lt;P&gt;Hi Mohit,&lt;/P&gt;&lt;P&gt;You need to define namespace in Runtine configuration of iflow.&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2048896-image.png" /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 18 May 2022 11:57:02 GMT</pubDate>
    <dc:creator>AdityaMani51</dc:creator>
    <dc:date>2022-05-18T11:57:02Z</dc:date>
    <item>
      <title>Filtering records based on Xpath expression</title>
      <link>https://community.sap.com/t5/technology-q-a/filtering-records-based-on-xpath-expression/qaq-p/12638697</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
  &lt;P&gt;I am trying to filter records based on the 2 digit country code(ISO_3166-1_Alpha-2_Code). I want to filter the records of workers working in country India(IN). Below is the xml source code.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;&amp;lt;wd:Get_Workers_Response xmlns:wd="urn:com.workday/bsvc" wd:version="v32.0"&amp;gt;
    &amp;lt;wd:Worker&amp;gt;
        &amp;lt;wd:Employment_Data&amp;gt;
            &amp;lt;wd:Home_Country_Reference&amp;gt;
                &amp;lt;wd:ID wd:type="ISO_3166-1_Alpha-2_Code"&amp;gt;AR&amp;lt;/wd:ID&amp;gt;
                &amp;lt;wd:ID wd:type="ISO_3166-1_Alpha-3_Code"&amp;gt;ARG&amp;lt;/wd:ID&amp;gt;
            &amp;lt;/wd:Home_Country_Reference&amp;gt;
        &amp;lt;/wd:Employment_Data&amp;gt;
        &amp;lt;wd:Personal_Data&amp;gt;
            &amp;lt;wd:Name_Data&amp;gt;
                &amp;lt;wd:First_Name&amp;gt;Rohit&amp;lt;/wd:First_Name&amp;gt;
                &amp;lt;wd:Last_Name&amp;gt;Singh&amp;lt;/wd:Last_Name&amp;gt;
            &amp;lt;/wd:Name_Data&amp;gt;
        &amp;lt;/wd:Personal_Data&amp;gt;
    &amp;lt;/wd:Worker&amp;gt;
    &amp;lt;wd:Worker&amp;gt;
        &amp;lt;wd:Employment_Data&amp;gt;
            &amp;lt;wd:Home_Country_Reference&amp;gt;
                &amp;lt;wd:ID wd:type="ISO_3166-1_Alpha-2_Code"&amp;gt;IN&amp;lt;/wd:ID&amp;gt;
                &amp;lt;wd:ID wd:type="ISO_3166-1_Alpha-3_Code"&amp;gt;IND&amp;lt;/wd:ID&amp;gt;
            &amp;lt;/wd:Home_Country_Reference&amp;gt;
        &amp;lt;/wd:Employment_Data&amp;gt;
        &amp;lt;wd:Personal_Data&amp;gt;
            &amp;lt;wd:Name_Data&amp;gt;
                &amp;lt;wd:First_Name&amp;gt;Shivam&amp;lt;/wd:First_Name&amp;gt;
                &amp;lt;wd:Last_Name&amp;gt;Dubey&amp;lt;/wd:Last_Name&amp;gt;
            &amp;lt;/wd:Name_Data&amp;gt;
        &amp;lt;/wd:Personal_Data&amp;gt;
    &amp;lt;/wd:Worker&amp;gt;
&amp;lt;/wd:Get_Workers_Response&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;I have used below Xpath expression.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;//wd:Employment_Data[wd:Home_Country_Reference/wd:ID = 'IN']&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;which gives me below output&lt;BR /&gt;&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;Element='&amp;lt;wd:Employment_Data xmlns:wd="urn:com.workday/bsvc"&amp;gt;
	&amp;lt;wd:Home_Country_Reference&amp;gt;
		&amp;lt;wd:ID wd:type="ISO_3166-1_Alpha-2_Code"&amp;gt;IN&amp;lt;/wd:ID&amp;gt;
		&amp;lt;wd:ID wd:type="ISO_3166-1_Alpha-3_Code"&amp;gt;IND&amp;lt;/wd:ID&amp;gt;
	&amp;lt;/wd:Home_Country_Reference&amp;gt;
&amp;lt;/wd:Employment_Data&amp;gt;'&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Output of this Xpath expr. doesn't contain Personal_Data node. Is it possible to filter records based on country(IN) and have both nodes (Employment_Data and Personal_Data) in the output by using Xpath expressions?? Or do we have to use XSLT for this transformation.&lt;/P&gt;
  &lt;P&gt;Expected Output.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;&amp;lt;wd:Get_Workers_Response xmlns:wd="urn:com.workday/bsvc" wd:version="v32.0"&amp;gt;
    &amp;lt;wd:Employment_Data&amp;gt;
        &amp;lt;wd:Home_Country_Reference&amp;gt;
            &amp;lt;wd:ID wd:type="ISO_3166-1_Alpha-2_Code"&amp;gt;IN&amp;lt;/wd:ID&amp;gt;
            &amp;lt;wd:ID wd:type="ISO_3166-1_Alpha-3_Code"&amp;gt;IND&amp;lt;/wd:ID&amp;gt;
        &amp;lt;/wd:Home_Country_Reference&amp;gt;
    &amp;lt;/wd:Employment_Data&amp;gt;
    &amp;lt;wd:Personal_Data&amp;gt;
        &amp;lt;wd:Name_Data&amp;gt;
            &amp;lt;wd:First_Name&amp;gt;Shivam&amp;lt;/wd:First_Name&amp;gt;
            &amp;lt;wd:Last_Name&amp;gt;Dubey&amp;lt;/wd:Last_Name&amp;gt;
        &amp;lt;/wd:Name_Data&amp;gt;
    &amp;lt;/wd:Personal_Data&amp;gt;
&amp;lt;/wd:Worker&amp;gt;
&amp;lt;/wd:Get_Workers_Response&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 May 2022 10:58:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/filtering-records-based-on-xpath-expression/qaq-p/12638697</guid>
      <dc:creator>MohitS</dc:creator>
      <dc:date>2022-05-17T10:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering records based on Xpath expression</title>
      <link>https://community.sap.com/t5/technology-q-a/filtering-records-based-on-xpath-expression/qaa-p/12638698#M4741144</link>
      <description>&lt;P&gt;Hi Mohit,&lt;/P&gt;&lt;P&gt;Try with below-&lt;/P&gt;&lt;P&gt;/wd:Get_Workers_Response [wd:Worker/wd:Employment_Data[wd:Home_Country_Reference/wd:ID = 'IN']]&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 13:09:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/filtering-records-based-on-xpath-expression/qaa-p/12638698#M4741144</guid>
      <dc:creator>AdityaMani51</dc:creator>
      <dc:date>2022-05-17T13:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering records based on Xpath expression</title>
      <link>https://community.sap.com/t5/technology-q-a/filtering-records-based-on-xpath-expression/qaa-p/12638699#M4741145</link>
      <description>&lt;P&gt;Hi Aditya,&lt;/P&gt;&lt;P&gt;Above expression doesn't filter out the Indian worker records.&lt;/P&gt;&lt;P&gt;Below Xpath expression works as expected while testing it in any online Xpath tester tool.&lt;/P&gt;&lt;P&gt;//wd:Worker[wd:Employment_Data/wd:Home_Country_Reference/wd:ID = 'IN']&lt;/P&gt;&lt;P&gt;However  it doesn't work while using in filter step in CPI.&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 11:37:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/filtering-records-based-on-xpath-expression/qaa-p/12638699#M4741145</guid>
      <dc:creator>MohitS</dc:creator>
      <dc:date>2022-05-18T11:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering records based on Xpath expression</title>
      <link>https://community.sap.com/t5/technology-q-a/filtering-records-based-on-xpath-expression/qaa-p/12638700#M4741146</link>
      <description>&lt;P&gt;Hi Mohit,&lt;/P&gt;&lt;P&gt;You need to define namespace in Runtine configuration of iflow.&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2048896-image.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 11:57:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/filtering-records-based-on-xpath-expression/qaa-p/12638700#M4741146</guid>
      <dc:creator>AdityaMani51</dc:creator>
      <dc:date>2022-05-18T11:57:02Z</dc:date>
    </item>
  </channel>
</rss>

