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
|
> 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/
|