xsl-list
[Top] [All Lists]

Re: Match first non-empty from different fragments

2005-01-21 07:47:38
The solution I was imagining would be like this:

Setup the following template matches:

match="z:row[(_at_)name_of_event]"
match="z:row[(_at_)date_of_event]"
...

Then, from the context of the parent to z:row, which is rs:data, my
apply-templates rule would somewhow seek the parent event source for
the z:row match when the immediate z:row was empty.

Karl..






On Fri, 21 Jan 2005 10:06:53 +0200, Jarno(_dot_)Elovirta(_at_)nokia(_dot_)com
<Jarno(_dot_)Elovirta(_at_)nokia(_dot_)com> wrote:
Hi,

Context node is results (top level if that is what context
node refers to)

Also, above "There are man z:row" should read "There are many z:row"

 name: <xsl:value-of
select="(result//rs:data/z:row/@name_of_event[string(.)])[last()]"/>

provided event result always precedes meet result.
It may or may not.

Ok, then you have to use some other expression.

Can you explain the above select?  I don't get it.

The above first selects all result//rs:data/z:row/@name_of_event attributes 
whose value is not empty string, then selects the last in document order. 
However, if the order in your source is not stable, you have to use some 
other system. Just use the xsl:choose to check if meet name is an empty 
string (remember to make sure you're checking if the value is empty, not if 
the attribute exists), then based on that select the result you want.

Cheers,

Jarno

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



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