This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Need Xpath Question (help).
- From: "Ragan, Mitch" <mitch dot ragan at boeing dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Mon, 28 Jan 2002 13:10:19 -0800
- Subject: [xsl] Need Xpath Question (help).
- Reply-to: xsl-list at lists dot mulberrytech dot com
Any one know the answer to either of these questions?
> Using this XPath Builder:
> <http://staff.develop.com/aarons/bits/xpath-builder/>
> (Dosent seem to work well in Netscape Browser) or XML file "Invoices"
> listed below.
>
>
> I am looking for the XPath that will :
>
> 1) Return the "LineItem" with the lowest Price "in each LineItems"
> (hint: the parent axis is easier to get working in this case than the
> sibling axes)
>
> something like? /Invoices/Invoice/LineItems/LineItem/Price
> [Price !> parent::Price] (only this one is incorrect)
>
> 2) Select all the text nodes, comment nodes, processing instruction
> nodes, and element nodes that come before the 49.95 Price node,
> except the ancestors of that Price node.
>
>
<?xml version="1.0" encoding="UTF-8"?>
<Invoices>
<Invoice ID='1000'>
<CustomerName>Jane Smith</CustomerName>
<LineItems>
<LineItem>
<Sku>134</Sku>
<Description>Dons Boxers</Description>
<Price>9.95</Price>
</LineItem>
<LineItem>
<Sku>153</Sku>
<Description>Rice Krispy COM Object</Description>
<Price>10000.00</Price>
</LineItem>
<LineItem>
<Sku>72</Sku>
<Description>Red Vines</Description>
<Price>4.95</Price></LineItem></LineItems></Invoice>
<Invoice ID='1010'>
<CustomerName>Storm Phillips</CustomerName>
<LineItems>
<LineItem>
<Sku>171</Sku>
<Description>COM is LOVE T-shirt</Description>
<Price>9.95</Price></LineItem>
<LineItem>
<Sku>200</Sku>
<Description>ATL Internals</Description>
<Price>49.95</Price></LineItem></LineItems></Invoice>
<Invoice ID='1020'>
<CustomerName>John Stockton</CustomerName>
<LineItems>
<LineItem>
<Sku>53</Sku>
<Description>Caffeinated Beverages</Description>
<Price>0.50</Price></LineItem>
<LineItem>
<Sku>22</Sku>
<Description>Friday Pizza</Description>
<Price>0.00</Price></LineItem>
<LineItem>
<Sku>201</Sku>
<Description>MFC Internals</Description>
<Price>39.95</Price></LineItem></LineItems></Invoice></Invoices>
Mitch K. Ragan
Boeing Commercial Aircraft Group
Global Electronic Commerce
Senior Systems Analyst 425-266-3155
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list