Facing Problem with Xpath if then else concept

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
4u.rajpal (1)
6/28/2011 8:27:39 AM
dotnet.xml 7266 articles. 0 followers. Follow

0 Replies
1889 Views

Similar Articles

[PageSpeed] 9

Reply:

Similar Artilces:

Active Directory Connector Problem with exchange 5.5.....
Background: Our company is "LA" and we have another sister company "SC" that are tree roots of the "SFB" forest. We share the same bridgehead that is located at "SFB". Yet we each have our own exchange in or domains. When I am running the ADC I am getting stuck on Step three the resorce mailbox wizard. I am geting this message "Pass 1 of 1: Resource Mailbox Scan validation (objects processed: 7799) Warning: The Exchange 5.5 directory still contains objects that need to be marked as resource mailboxes before they can be replicated to Activ...

IDE problem
TheClassFile.h -------------------------------------------------------------------- class Blah_Fooh { public: enum eModule { eBlah1 = 0, eBlah2 = 1, eBlah3 = 2, }; Blah_Fooh(); virtual ~Blah_Fooh(); bool AFoohFooh( CString &data, enum Blah_Fooh::eModule module ); }; TheClassFile.cpp -------------------------------------------------------------------- .... bool Blah_Fooh::AFoohFooh( CString &data, enum Blah_Fooh::eModule module ) { bool result=false; .... .... return result; } I have created the above class in my project. I have a method (above) in which the parameter...

Serialization problem 03-05-10
Hi, For my webapplication I have a structure with strings, booleans and datasets. I use it to store the information that the user has entered. The datasets contain data from a part where the user can add multiple rows of data. I want to move this data to a file so it can be read by a windows application. The webform is basicly a request form. I thought of serializing it because that is a nice way to transfer the data. When I serialize the data to a file, all the data from the strings, dates and booleans are in it, but from the datasets I only see the structure but not the ...

Problem loading account details
After a disk problem, I upgrade Win 2000, applied service packs and reinstalled apps stc. The data files were fine. Money opens the data file fine and in the home page displays the correct balances and last few transactions on each account, but when I go to open the account to maintain it, I get thefolowing message: 'Money cannot determine which place to load. Please re- install....' I've re-installed as administrator, no joy. Can anyone offer a suggestion? Thanks in anticipation Graham White In microsoft.public.money, Graham wrote: >After a disk problem, I upgrade ...

problems with setItemText()
Hi I am not sure why I am having the following behavior with SetItemText() I have the following simple code Index = GLOBALCONTROLLIST->InsertItem(0, "test1"); GLOBALCONTROLLIST->SetItemText(Index, 1, "test2"); GLOBALCONTROLLIST->SetItemText(Index, 2, "test3"); GLOBALCONTROLLIST is just a reference to the CListCtrl The report is not sorted. I get "test1" in the first column, but the rest of the columns don't display any text value. I noticed that false is returned from these references. Any ideas on what is wrong? Thanks Did you set...

Problem using Task Scheduler API
Hello, I wrote an MFC wrapper class for the Task Scheduler COM API and I'm using it in my application to add/remove/modify scheduled tasks. This is my problem: on some computers (in particular a Toshiba laptop running Windows XP) the scheduled tasks don't start correctly when they are scheduled to run as the Local System account. What happens is that the process is started but then without executing any user code, it exits. The task scheduler reports that the task ran correctly and the task scheduler log file shows that it started and exited the same second (this behaviour is incor...

how do I setup an excel table that outlines the face of a standar.
...

Email problems
Hello, I am trying to create a procedure in excel that weill take the info from a range or select cells and paste them into the body of an email message. but am running into a number of probs. Firstly our default email program is eudora, it seems to work when you choose the File, Send to however this only gives me the option to send as an attachment. It sounds as though there should be an "email" button on the standard toolbar but mine does not (excel 2000) must I use outlook to get this to work? how can I get the email button to show on my toolbar?? Does anyone know how I cou...

Problem with printing greeting cards in Publisher
Hi! I am trying to print a greeting card that has one side as glossy paper and the other matte. I have spent ages trying to figure out how to get it to print just page 1 and page 4 in one print format for the glossy paper and print pages 2 and 3 in matte paper but cannot seem to get it right :( I have wasted a lot of paper and card and I'm sure there must be a simple answer but it has me stumped. I don't want to have to print one page at a time as it never seems to work right and I end up getting confused as to which side should be where etc. Is it possible? Thank you. I ...

Multiple charts in ChartSpace; problems with double Categories #4
Jon Peltier Wrote: > Office Web Components. > > This is an issue I need to investigate for one of my clients, but I > haven't gotten > that far down the list yet. > > - Jon > > John Mansfield wrote:- > It would help to know if you are using Excel VBA, .NET, or something > else. > Also, what do you mean by Chartspace? Are you trying to build > embedded > charts, chart sheets, or some combination of the two? > > Regards, > John Mansfield > http://www.pdbook.com > > > "hstaaks" wrote: > > - > hstaaks W...

sscanf problem.
I know it's not really an MFC problem, but it is in an MFC based APP. The followng code: char cs[3]; BYTE b; m_EntryMac[0].GetWindowText(cs, 2); sscanf(cs, "%X", &b); This code causes a fault at the sscanf line, but only in release mode. Works fine in debug mode. The m_EntryMac[0] is an edit field allowing only 2 characters of entry. So it is trying to convert the users input of something like 'A1' into 0xA1. Does that make sense? Anyway, why doesn't it work at runtime in release mode? Help appreciated. Regards Control Freq schrieb: > > ...

Serial port problem
I've just noted my RS-232 doesn't work good with low battery! Is this possible? I always communicated via serial port of my Windows CE device (3.3 V based) without lost of data. However if you disconnect the unit from the power and leave the battery goes down.. the communication starts to fails.. that is some byte is lost (the greatest part is sent good). Has this a technical reason or not? QU We don't have your schematics, nor do we know with what external device you are communicating, so we'd just be guessing. Typically, RS-232 means voltage levels muc...

Slight Problem
I have the following code but when the cancel button on my input box is pressed the "invalid password" message is still displayed. Can someone help so when the cancel button is pressed then that is exactly what happens, the input box is cancelled. Dim MyStr1 As String, MyStr2 As String MyStr2 = ("engineering") MyStr1 = InputBox("Please Enter The Required Password") If MyStr1 = MyStr2 Then Sheets("Sheet2").Select Range("A9").Select Else MsgBox "Incorrect Password. Access Denied", vbCritical Range...

Problem: textbox default value = Date()
I want an unbound textbox on my form to default to current date. In the default value property of the textbox, I put "=Date()". Instead of today's date, it defaults to the text "date". What am I doing wrong? (I see if I bind the textbox to "=Date()", the value, of course, is today's date, but I only want the default to be today's date, which can be changed as needed.) TIA Are you actually entering "=Date()" or are you entering =Date() without the double quotes? If the latter, it should give you the date! -- There's AL...

Problem with autoarchive feature
Autoarchive has been working properly up until today. Now it goes through the process of autoarchiving all my folders and at the end of the process a dialoge box appears with the following message; "Errors occured whaile archiving. Look for a detailed report in your Deleted Items folder." Below is the information in the report; Error while archiving folder "Inbox" in store "Personal Folders". Error while archiving folder "Sent Items" in store "Personal Folders". Error while archiving folder "Calendar" in store "Perso...

CPropertySheet
Hi, Thank you for checking my post. I am trying to change the default face or bkColor of the default OK/CANEL/APPLY buttons in a CPropertySheet derived class. I have tried OnCtlColor and that didn't work. I have considered removing the buttons and redrawing my own in their place but that seems like a brutal solution. I have made a dutiful effort to find a solution on various newsgroups but the more I look, the more confused I get. Any and all suggestions would be very much appreciated. Please note that I have 1 years experience on MFC. Thank you. Michael Hi Michael, Button c...

Access Denied problem with CreateFile
Hallo, I have a problem when using the CreateFile function to access the COM port.In my application i create a dialog box.When the initdialog function is called i initialise the port and then do the other things that i have to with the port. It works fine. The funny part is that once i close this dialog box and open it again without closing the entire application the CreatFile function returns ACCESS_DENIED error.But if i close the entire application and then restart it everythin is fine.I have a class that accesses the serial port.This class also uses threads to access the port.But when the d...

Money 2003 Passport Problem
I searched all the prior posts and couldn't find an answer to this question. When trying to add my Passport acct. to my money file, I get the following error message repeatedly, "Money cannot connect to the Microsoft .NET passport servers, possibly because of a problem with your internet connection..." Since I transfered the money file and added the Passport to my work computer and everything went fine, it seems as if the problem is isolated to my home computer. Does anyone know of a resolution to fix this problem? FYI, I've re-installed Money 2003 already, cleared my bro...

Logical ELSE statements
ELSE statements appear to be unavailable. How would I write this CALCULATOR to produce the correct Paid Out Commission given: Data entered by a person is 1) Gross Commissions (D5), 2) Product Code (D6), 3) Level 1,2,3,or 4 payment mode (D7). Product codes are in an Excel worksheet 'NY ONLY' column b/rows 4-225; Levels 1 to 4 in cols h-k. The 'NY ONLY' worksheet contains the Level 1-4 payment %'s that I'm trying to multiply Gross Commissions (D5) by. Current logic expression works for one product: =IF(AND($D$6='NY ONLY'!$B$4, $D$7=1), $D$5*'NY ...

calculation problem 09-04-07
I am working in several tabed forms with one table, I have worked out a sum for several fields and all is good.... what i cant do is bring that value to a new field in another tabed form. Like this form A with obj1 + obj2 + obj3 shows value in "total" how do i get value "total" in form A to a new field in form B? Thanks all for your help!! If form A & B are open you could "push" the value to form B using form!form_B!new_value =me!value or "pull" the value from form_a using me!new_value=form!form_A!value value is the name of ...

I am Facing a problem #2
Hi, I am facing a problem. I am developing a dialog based application. I loaded microsoft web browser Control in the dialog I have a javascript file and loades inside the browser. The script file has a command button. Problem!!!!! When the command button is pressed, I want a message box to be displyed from the dialog class not from the script. Please suggest!!!!!!!!!!!! Thanks Sumanta <rout.sumanta@gmail.com> wrote in message news:1172818928.375138.26740@30g2000cwc.googlegroups.com... > Hi, > I am facing a problem. > > I am developing a dialog based application. > ...

A newbie paradox: is this a PK-FK (relationship) problem, or programming problem?
I'm getting the hang of database architecture design I think, along with easy to code, drag-and-drop Access 2003 forms programming--great front end. But I have a question about a form involving three tables--and I'm not sure if this is a programming question or a database architecture question, hence the crosspost. I have three tables to model a stock portfolio (buying and selling by a single person having numerous accounts): Stock_Accounts (plural), in a single table (red flag), which belong to a single individual, then a stock table, Stocks, listing all the stocks owned by the ind...

401K Download Problem
I am having problems downloading my 401k data from Fidelity Netbenefits. I have a call out to them as well to see if there is a problem. This has worked for me no problem for more than a year on MS Money 2005. The last two weeks, I get an error message everytime I update. The rest of my accounts (checking, savings, credit cards, etc.) are all working, just this one is not I ended up upgrading to MS Money 2007 for other reasons, but this problem continues. Does anyone have suggestions about what to do to fix this? Thanks! ...

Printing problem in booklet format
When I try to print my booklet document, on the screen it looks perfect, but when i go into print preview it only has half of each page on the paper. When i print, it comes out exactly like that. I have Publisher 2003 and run it on XP home. My printer is an Epson stylus Photo RX650. I contacted Epson and they say its a Publisher problem. Any suggestions. Driver? http://tech.epson.com.au/downloads/product.asp?sCategory=Multi_Functional&id=stylusphotorx650&FileType=1&EmailAdd=&MetricIDReturned=624915&platform=winxp Are you selecting booklet in page setup? Do you ...

VBA Help problem
I'm using Office 2003 SP3 on Win 2000 SP4. When I use VBA help, if thee are hyperlinks on the page I get a popup with the following error: "Runtime error has occurred" Line 16: Error: not implemented If I choose debug from this dialog box I am taken to a script and another error popup: "htmlfile: Not implemented" there is a yellow arrow at the line: "document.onclick = window.parent.closeList" Am I missing a reference somewhere in VBA or is this a more serious problem? The Windows 2000 install has been around a long time... I've ...