XPATHSNIPPET Unusual Behaviour

Hi,

I am seeing a very unusual behaviour with xpathsnippet function.

Example - I have 2 different branches within my XML:

1. <ParentNode>

      <Child Node>

           <LatestValue>

                   <Attributes>

                   <XYZ>1.0<XYZ>.......and so on

           <HistoricalValue>

                   <Attributes>

                   <XYZ>8.70<XYZ>.......and so on

Now I am trying to access the LatestValue using xpathsnippet function and sometimes there is a case when we don't have LatestValue node itself so only Historical Value is present in that scenario ideally it should return NULL but it is fetching HistoricalValue and returning 8.70 which is a wrong value.

Is this the expected behaviour of this function OR I am missing something?

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to PGarg

    Oh I see!

    This might seem silly but how about a scenario having same value for both the LatestValue and the Historical Value nodes which can lead to miss interpretation. Reason why I have brought up this because the code that you have posted looks super fine to me which should work.

    Could you please confirm that there is no such miss interpretation? This will arise the need to look in to this issue more deeper.

Children