Incorrect Xpath : The Xpath expression to grab the agent names returns nothing. The Xpath expression can be found here. The following 2 expression works and returns the result.
private static final String FRAGMENT_PATH = "//us-parties/agents/agent|//agents/agent";
or
private static final String FRAGMENT_PATH = "//us-parties/agents/agent|//parties/agents/agent";
The if conditionhere
This condition checks whether the agent name is null. If it is then, agent is not added to the final result. Below is an example when the if condition will fail.
Agent names are absent in the final output json.
TEST DATA
AS-IS
SHOULD BE
CAUSE/Solutions
Incorrect Xpath : The Xpath expression to grab the agent names returns nothing. The Xpath expression can be found here. The following 2 expression works and returns the result.
or
if
condition here This condition checks whether the agent name is null. If it is then, agent is not added to the final result. Below is an example when the if condition will fail.Here, we only have the
orgname
tag. The agent name is absent. We can atleast add the orgname in the output json.Thanks.