Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Selecting a node with child and parent condition.

From: Joe Kesselman <keshlam-nospam@-------.--->
To: NULL
Date: 9/10/2007 11:44:00 PM

okaissi79@g... 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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent