xsl-list
[Top] [All Lists]

RE: [xsl] Can this all fit into one Xpath expression?

2009-04-14 15:37:09

I have a structure with conditions something like this:

//GenTable/table/tgroup/tbody/row/entry[Emphasis = 'Address 
Offset'] and Emphasis[(_at_)type='bold']

//GenTable/table/tgroup/tbody/row/entry[Emphasis = 'Physical 
Address'] and Emphasis[(_at_)type='bold']

//GenTable/table/tgroup/tbody/row/entry[Emphasis = 
'Instance'] and Emphasis[(_at_)type='bold']

//GenTable/table/tgroup/tbody/row/entry[Emphasis = 
'Description'] and Emphasis[(_at_)type='bold']

//GenTable/table/tgroup/tbody/row/entry[Emphasis = 'Type'] 
and Emphasis[(_at_)type='bold']


If a GenTable element has four or the five entry elements, 
that match these conditions, i want to set 
GenTable[(_at_)role='Register'] and GenTable[(_at_)columns='1'].

Can this be squeezed into one hairy Xpath expression.

Sorry still trying to get my head around multiple predicates.


I suspect from your last sentence that the code you have supplied doesn't
mean what you think it means, but I don't know what you think it means
because you haven't told us, so I don't know how to correct it.

It's certainly possible to express the condition you want in XPath (even the
condition that only four out of the five predicates need to be true - though
that one is almost certainly easier in XPath 2.0). But this bit:

i want to set GenTable[(_at_)role='Register'] and GenTable[(_at_)columns='1'].

is beyond the capability of XPath (either version). XPath is a read-only
query language.

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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>