Need help with xPath

5
Hi, I'm new to xpath queries. Given the above model and a Ride, I want to retreive a list of cargo where $Ride/DateArrival=$Cargo/DatePickup AND the ContainerType of the Ride is one of the container types of the Cargo (a cargo can have MULTIPLE containertypes). I'm at a loss as to what the xpath should be.... Thanks in advance, John
asked
2 answers
4

Did you check the XPATH tutorials?

I think this one does the trick. Retrieve Cargo with constraint (note that Module needs to be substituted with your module name, but using the autocompletion this should be trival):

[Module.Cargo_ContainerType/Module.ContainerType/Module.Ride_ContainerType/Module.Ride/DateArrival = DatePickup]

Note that your second AND clause is implicit; the Arrival date and Pickup date are not comparable in your domain model (in a single query) if there is no relation at all.

Furthermore make sure that you use the trimToDays function when storing the arrival/ pickup date, otherwise the dates will not be seen as equal if they do not happen at exactly the same millisecond.

answered
3

I think I wasn't clear about the fact that the Ride is used as an input. I figured it out, turns out to be quite simple:

[DatePickup=$Ride/DateArrival]
[AllRide.Cargo_ContainerType=$Ride/AllRide.Ride_ContainerType]
answered