Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Facing Problem with Xpath if then else concept

35 views
Skip to first unread message

jatin

unread,
Jun 28, 2011, 4:27:39 AM6/28/11
to
XML File:
<additionalFields>
<field name="dataKey">3868</field>
<field name="distribution">140</field>
</additionalFields>

I would like to execute following If else Xpath 2.0 statement.

String text = nav.Evaluate("if(/additionalFields/
field[@name='distribution']/text() = '140') then 'C' else ' '
").ToString();

However I am getting following error message:
'if(/additionalFields/field[@name='distribution']/text() = '140') then
'C' else ' ' ' has an invalid token.

Is there any other way to achieve the result? Any help would be
appreciated.

0 new messages