0

I am trying to get the position of item based on timestamps, but do not get the right result....

Here is the XML file

<?xml version="1.0" encoding="utf-8"?>
<d:data xmlns:d="defiant-namespace" d:constr="Array" d:mi="432">

    <ITEMS
     ABOVE>


    <d:item d:mi="12">
        <properties d:mi="8">
            <notification d:mi="7">
                <userInfo d:mi="3">
                    <UIDeviceOrientationRotateAnimatedUserInfoKey d:constr="Boolean" d:mi="1">false</UIDeviceOrientationRotateAnimatedUserInfoKey>
                    <orientation d:constr="Number" d:mi="2">1</orientation>
                </userInfo>
                <class d:constr="String" d:mi="4">UIDevice</class>
                <pointer d:constr="String" d:mi="5">0x1c0039920</pointer>
                <name d:constr="String" d:mi="6">UIDeviceOrientationDidChangeNotification</name>
            </notification>
        </properties>
        <timestamp d:constr="String" d:mi="9">2018-02-02T15:36:08.2320+0100</timestamp>
        <event d:constr="String" d:mi="10">notification</event>
        <mediaTime d:constr="Number" d:mi="11">12376.231543666667</mediaTime>
    </d:item>


     <MANY 
     ITEMS 
      BETWEEN>



    </d:item>
    <d:item d:mi="50">
        <properties d:mi="46">
            <notification d:mi="45">
                <userInfo d:mi="41">
                    <UIDeviceOrientationRotateAnimatedUserInfoKey d:constr="Number" d:mi="39">1</UIDeviceOrientationRotateAnimatedUserInfoKey>
                    <orientation d:constr="Number" d:mi="40">1</orientation>
                </userInfo>
                <class d:constr="String" d:mi="42">UIDevice</class>
                <pointer d:constr="String" d:mi="43">0x1c0039920</pointer>
                <name d:constr="String" d:mi="44">UIDeviceOrientationDidChangeNotification</name>
            </notification>
        </properties>
        <timestamp d:constr="String" d:mi="47">2018-02-02T15:36:08.6960+0100</timestamp>
        <event d:constr="String" d:mi="48">notification</event>
        <mediaTime d:constr="Number" d:mi="49">12376.694827083335</mediaTime>
    </d:item>

</d:data>

So I need to get all the items between timestamps like

2018-02-02T15:36:08.2320+0100 and 2018-02-02T15:36:08.6960+0100

I tried //*[contains(timestamp,"2018-02-02T15:36:08.2320")] and //*[contains(timestamp,"2018-02-02T15:36:08.6960")] but it only return the actual items..anyone knows how to get all the items in between?

Thanks.:)

P.W
  • 21
  • 7
  • Possible duplicate of [xpath dates comparison](https://stackoverflow.com/questions/4347320/xpath-dates-comparison) – Ian Lesperance Mar 03 '18 at 16:53
  • I tried the method of translate the timestamp into numbers in the duplicated thread , it works now!! This is great! Thank you :)) – P.W Mar 03 '18 at 17:27

0 Answers0