Forum Stats

  • 3,875,115 Users
  • 2,266,806 Discussions
  • 7,912,086 Comments

Discussions

convert path query to xquery

NinaOracle
NinaOracle Member Posts: 39
edited Dec 5, 2013 7:33PM in XQuery

Hello

I need to convert this path regions/africa/item[[[NOT[/location="United States"]] AND /quantity="1" AND /payment="Creditcard"] OR shipping="Will ship only within country"]

to xquery, where the data stored in standard.xml

Thank you

Answers

  • tsuji
    tsuji Member Posts: 179 Bronze Badge
    I need to convert this path regions/africa/item[[[NOT[/location="United States"]] AND /quantity="1" AND /payment="Creditcard"] OR shipping="Will ship only within country"]
    to xquery, where the data stored in standard.xml
    

    You need to convert, whatever it means, the xpath, all right. But, to begin with, does it really work? Those /location, /quantity and /payment are absolute (and not relative) xpath. Do you really mean that?

  • NinaOracle
    NinaOracle Member Posts: 39

    I found the solution if someone is interested

    <result>
    {
    for $i in doc("standard.xml")//item
    where not(($i/location="United States" and $i/quantity="1" and $i/payment="Creditcard") or $i/shipping="Will ship only within country")
    return count($i)
    }
    </result>


    Thanks all

This discussion has been closed.