xsl-list
[Top] [All Lists]

RE: XPATH | union operator question

2003-12-21 07:43:46
-----Original Message-----
From: Marc Liyanage

On 21.12.2003, at 14:24, Andreas L. Delmelle wrote:

Perhaps Mike Kay's answer earlier on in this thread could be the
solution :

<xsl:value-of select="(thing[lang($mylang)] | thing)[last()] />

I read that, but I guess that's useful for the original problem, where
you have a hierarchy, i.e. you have an outermost and an innermost node

Ah! I thought it worked like this :

first the XPath union operator constructs a set, say
<thing xml:lang="en" />
<thing />

and the [last()] would be evaluated on the nodes in document order, which,
in this case would always yield the more specific of the two (and the
default only when the first is also the last).

<snip />

Unfortunately I have no control over the input docs in this particular
application.


But this could probably also mean that my above supposition would be
unreliable... :(

The solution proposed by Dimitre Novatchev earlier today works very
well for me.


Yup! A very good one indeed.


Cheers,

Andreas


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



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