I am reading XML file in UIPATH and my requirement is to count the number of entries for brand “BMW” despite its model. GIven example, should return “3”. Could you please help me to achieve this or give leads to find a solution.
<country>
<state>Texas</state>
<cars>
<brand>BMW</brand>
<model>X1</model>
<unit>210000</unit>
</cars>
<cars>
<brand>BMW</brand>
<model>X6</model>
<unit>210000</unit>
</cars>
<cars>
<brand>BMW</brand>
<model>X7</model>
<unit>210000</unit>
</cars>
<cars>
<brand>Ford</brand>
<model>mustang</model>
<unit>319000</unit>
</cars>
<cars>
<brand>Volvo</brand>
<model>XC90</model>
<unit>91100</unit>
</cars>
</country>
You could use the Execute XPath function and use the following XPath to get the count in one action only:
count(//cars/brand[text()='BMW'])