wrote:
> <DeliverySchedule>
> <Header>
> <DistributorCode>MC</DistributorCode>
> <TransmissionDate>2007-01-02</TransmissionDate>
> <TransmissionTime>14:02:00.000</TransmissionTime>
> </Header>
> <Detail>
> <StoreDelivery>
> <SiteNum>001507</SiteNum>
> <DSchedule>
> <Order>
> <Date>2007-09-02</Date>
> <Time>08:02:01.000</Time>
> </Order>
> <Delivery>
> <Date>2007-09-03</Date>
> <Time>06:12:02.000</Time>
> </Delivery>
> </DSchedule>
> <DSchedule>
> <Order>
> <Date>2007-09-04</Date>
> <Time>08:02:03.000</Time>
> </Order>
> <Delivery>
> <Date>2007-09-05</Date>
> <Time>06:12:04.000</Time>
> </Delivery>
> </DSchedule>
> </StoreDelivery>
> <StoreDelivery>
> <SiteNum>001510</SiteNum>
> <DSchedule>
> <Order>
> <Date>2007-09-02</Date>
> <Time>08:02:05.000</Time>
> </Order>
> <Delivery>
> <Date>2007-09-03</Date>
> <Time>06:12:06.000</Time>
> </Delivery>
> </DSchedule>
> <DSchedule>
> <Order>
> <Date>2007-09-08</Date>
> <Time>08:02:07.000</Time>
> </Order>
> <Delivery>
> <Date>2007-09-09</Date>
> <Time>06:12:08.000</Time>
> </Delivery>
> </DSchedule>
> </StoreDelivery>
> </Detail>
> <Count>4</Count>
> </DeliverySchedule>
>
>
> I need to query the "Order" field or child where the field "Date"
> inside it is equal for example "2007-09-02" and its parent "SiteNum" =
> 001507. Can I do that?
The simple answer is "yes".
The longer answer is: Using which query language, and starting from
where in the document? Assuming XPath and a global search (which will
usually not be most efficient solution), one of many ways to express
this would be
//Order[Date='2007-09-02' and ../../Sitenum='001507']
See any good XPath tutorial to understand why this works, and what the
alternatives might be.
If you want to use another query language, see tutorials for that
language instead, of course.
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry