That's an excellent question. As far as I can see, you have
to use a
hack, the as of now undocumented XPath extension function
ext-if().
Here is how:
<div select="item"
values="class:ext-if(position() mod 2 =
0,'white','green')">...</div>
This will create as many divs as your input document has
<item>
elements. Every even numbered div will get the CSS class
"white", the
odd numbered ones the CSS class "green".
Beware that XPath starts couning things at 1, that is, the
value of
position() for the first element matched by the expression
in the
select attribute will be 1, not 0. So the first div will be
class="green".
As you can easily guess from the example, the ext-if()
function takes
three arguments. If the first argument evaluates to boolean
true, then
it returns the value of its second argument, otherwise it
returns the
value of its third argument.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Google Homepage API" group.
To post to this group, send email to Google-Homepage-API googlegroups.com
To unsubscribe from this group, send email to
Google-Homepage-API-unsubscribe googlegroups.com
For more options, visit this group at ht
tp://groups.google.com/group/Google-Homepage-API
-~----------~----~----~----~------~----~------~--~---
|