Xpath question

I have a xml document that has <Days> as an Element. The sample of the xml document is shown below.
I want to build an Xpath expression to see if the supplied Days (that is passed by the caller method) falls between which Nodes. For example, if the supplied Days is 42, then the Xpath expression should show that the value 42 falls between Days 40 which is in CurveName2 tag and Days 50 which is in CurveName3 tag. Does XPath has any functions that can accomplish this requirement

<Curves>
<CurveName1>
<Days>30</Days>
<Rate>3.2></Rate>
<Frequency>Quarterly</Quarterly>
</CurveName1>
<CurveName2>
<Days>40</Days>
<Rate>4.8></Rate>
<Frequency>Quarterly</Quarterly>
</CurveName2>
<CurveName3>
<Days>50</Days>
<Rate>3.2></Rate>
<Frequency>Quarterly</Quarterly>
</CurveName3>

</Curves>



Answer this question

Xpath question

  • ToreS

    I get the feeling you're in the wrong forum. XPath discussions in this forum relate to a specific subset of the XPath specification as defined for HD-DVD authoring.

    Have you tried looking through the reference at W3Schools

    http://www.w3schools.com/xpath/default.asp




  • Tryst

    the xml file is

    <Curves>
    <Curve id="1">
    <Days>30</Days>
    <Rate>3.2></Rate>
    <Frequency>Quarterly</Frequency>
    </Curve>
    <Curve id="2">
    <Days>40</Days>
    <Rate>4.8></Rate>
    <Frequency>Quarterly</Frequency>
    </Curve>
    <Curve id="3">
    <Days>50</Days>
    <Rate>3.2></Rate>
    <Frequency>Quarterly</Frequency>
    </Curve>
    </Curves>



  • Xpath question