xpath date comparison using textbox

后端 未结 1 708
清歌不尽
清歌不尽 2021-01-27 15:53

my xml file :-


    
        
            
                 


        
相关标签:
1条回答
  • 2021-01-27 16:16

    The following query should work:

    let $ref-date := xs:date("1989-03-10")
    let $data := <root>
        <name id="1">
            <region value="001">
                <date value="1989-03-09"/>
            </region>
        </name>
        <name id="2">
            <region value="002">
                <date value="1989-03-11"/>
            </region>
        </name>
    </root>
    return $data/name[region/date/xs:date(@value) lt $ref-date]
    

    You can try it live at http://www.zorba-xquery.com/html/demo#r0KwHwjp1weVwefDUn1Z6roVD3A=

    0 讨论(0)
提交回复
热议问题