?
=?ISO-8859-1?Q?Une_B=E9vue?=
my xml fragment :
<select id='aId'>
<option>option 1</option>
<option>option 2</option>
[...]
<option>---?---</option>
<option>option n + 1</option>
<option>option n + 2</option>
[...]
</select>
and i want to set the class attribute of all the options to :
add if text() = '---?---' (the easiest case allready done) ;
odd if the position() of option is odd and the element is before the one
having text() = '---?---'
even if the position() is even and before '---?---'
odd_edited if position is odd and the element is after '---?---'
even_edited if position is even and after '---?---'
i did the easiest case like that :
add for xhtml://select[@id = 'aId']/xhtmlption[text() = '---?---']
i'm also able to choose odd/even position :
xhtml://select[@id = 'aId']/xhtmlption[not(text() = '---?---') and
((position mod 2) = 0)]
i knwo that to choose the elements before the element '---?---' i have
to do something like :
following-sibling::xhtmlption[text() = '---?---']
for the elements before '---?---' and preceeding-sibling for the
elements after.
BUT what i don't know exactly is how to add this rule to the firsts
above ???
<select id='aId'>
<option>option 1</option>
<option>option 2</option>
[...]
<option>---?---</option>
<option>option n + 1</option>
<option>option n + 2</option>
[...]
</select>
and i want to set the class attribute of all the options to :
add if text() = '---?---' (the easiest case allready done) ;
odd if the position() of option is odd and the element is before the one
having text() = '---?---'
even if the position() is even and before '---?---'
odd_edited if position is odd and the element is after '---?---'
even_edited if position is even and after '---?---'
i did the easiest case like that :
add for xhtml://select[@id = 'aId']/xhtmlption[text() = '---?---']
i'm also able to choose odd/even position :
xhtml://select[@id = 'aId']/xhtmlption[not(text() = '---?---') and
((position mod 2) = 0)]
i knwo that to choose the elements before the element '---?---' i have
to do something like :
following-sibling::xhtmlption[text() = '---?---']
for the elements before '---?---' and preceeding-sibling for the
elements after.
BUT what i don't know exactly is how to add this rule to the firsts
above ???