[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Re: Can this all fit into one Xpath expression?

Subject: RE: Re: Can this all fit into one Xpath expression?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 15 Apr 2009 15:49:23 +0100
RE:  Re: Can this all fit into one Xpath expression?
> I got partway there, on my own with the following:
> 
> //row/entry[Emphasis = 'Address 
> Offset']/ancestor::row/following-sibling::row/entry[Emphasis 
> = 'Physical Address']/following-sibling::entry[Emphasis = 
> 'Instance']/ancestor::row/following-sibling::row/entry[Emphasi
> s = 
> 'Description']/ancestor::row/following-sibling::row/entry[Emph
> asis = 'Type']/ancestor::GenTable[1] 
> 
> This more closely matches the location of the elements as 
> they are in the document

Does the location matter? I would have expected something like

//GenTable[row[entry/Emphasis = 'Address Offset' and
entry/Emphasis='Physical Address' and entry/Emphasis ... ]]

, but this still doesn't check for 
> @type='bold' 

If @type='bold' has to be true in each case, that would be

//GenTable[row[entry/Emphasis[. = 'Address Offset' and @type='bold] and
entry/Emphasis[.='Physical Address' and @type='bold'] ...]] 

or the condition that at least 4 of these 
> conditions be true.

That's then

//GenTable[count(row[entry/Emphasis[. = 'Address Offset' and @type='bold] or
entry/Emphasis[.='Physical Address' and @type='bold']
or ...] >= 4]

(If I've understood correctly)

Michael Kay
http://www.saxonica.com/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.