Illegal characters in path

I'm getting an XML dataset from a web service passed as a string.
I then do
XmlDocument myXmlDoc = new XmlDocument();
myXmlDoc.Load(mystring);

This causes an exception: Illegal characters in string.  the string contains

<?xml version=\"1.0\" 
encoding=\"UTF-8\"?>\n<validate>\n\t\t\t\t\t<error>\n\t\t\t\t\t\t<message>Login 
failed</message>\n\t\t\t\t\t</error>\n\t\t\t\t\t<sessionid/>\n\t\t\t\t</validate>

Is there something wrong with this string?  could those tabs be causing the 
problem?

Is there a utility tester anywhere that will tell me what's whats wrong with 
an xml string?

Regards,
Gary Blakely


0
GaryDean (6)
3/30/2007 9:51:52 PM
dotnet.xml 7266 articles. 0 followers. Follow

3 Replies
919 Views

Similar Articles

[PageSpeed] 7

Hello Gary,

The XmlDocument.Load method is expecting a file name or a URL. If you want 
to load the XML from a string, you need to use the XmlDocument.LoadXml method.

Thanks,
-Helena Kotas, MSFT

"GaryDean" wrote:

> I'm getting an XML dataset from a web service passed as a string.
> I then do
> XmlDocument myXmlDoc = new XmlDocument();
> myXmlDoc.Load(mystring);
> 
> This causes an exception: Illegal characters in string.  the string contains
> 
> <?xml version=\"1.0\" 
> encoding=\"UTF-8\"?>\n<validate>\n\t\t\t\t\t<error>\n\t\t\t\t\t\t<message>Login 
> failed</message>\n\t\t\t\t\t</error>\n\t\t\t\t\t<sessionid/>\n\t\t\t\t</validate>
> 
> Is there something wrong with this string?  could those tabs be causing the 
> problem?
> 
> Is there a utility tester anywhere that will tell me what's whats wrong with 
> an xml string?
> 
> Regards,
> Gary Blakely
> 
> 
> 
0
3/30/2007 10:48:04 PM
Hi Gary,
Thanks for Helena's reply.

public virtual void Load (string filename)

XmlDocument.load method is used for loading xml document from file.

http://msdn2.microsoft.com/en-us/library/875kz807.aspx
XmlDocument.Load Method

Howerver, if you want to load xml from string object, XmlDocument.LoadXml 
method is support in this scenario.

http://msdn2.microsoft.com/en-us/library/system.xml.xmldocument.loadxml.aspx
[XmlDocument.LoadXml Method]

By the way, about how to test what wrong with an xml string? Copy the xml 
string into xml file and open it with IE. Internet Explorer will tell us 
the story.

Hope this helps,
Sincerely,
Wen Yuan
Microsoft Online Community Support 
==================================================
Get notification to my posts through email? Please refer to 
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
 
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues 
where an initial response from the community or a Microsoft Support 
Engineer within 1 business day is acceptable. Please note that each follow 
up response may take approximately 2 business days as the support 
professional working with you may need further investigation to reach the 
most efficient resolution. The offering is not appropriate for situations 
that require urgent, real-time or phone-based interactions or complex 
project analysis and dump analysis issues. Issues of this nature are best 
handled working with a dedicated Microsoft Support Engineer by contacting 
Microsoft Customer Support Services (CSS) at 
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

0
v-wywang (104)
4/2/2007 4:23:01 AM
Hi Gary,

Just want to check whether the issue has been resolved.
If it still persists or you have anything unclear, please feel free to let 
me know. I'm glad to assist you.

Have a great day,
Sincerely,
Wen Yuan

0
v-wywang (104)
4/4/2007 11:29:29 AM
Reply:

Similar Artilces:

delete characters values
Hello All! I have a column with both characters values and numeric values. I would like to delete from that column only character values. Does someone know how to do it? Thanks in advance regards Emanuela This will require a custom vba function to strip out the non-numeric characters. Paste the two functions below into a VBA module and call one of them in your query. They work slightly different. Field: fStripToNumbersOnly(YourFieldName) Public Function fStripToNumbersOnly(ByVal varText As Variant) As String 'Takes input and returns only the numbers in the input. Strips out '...

weird characters are displayed
Hi, I am importing a TXT file into excel, by right clicking on the file in Explorer and then using the option 'Open with'. The file displays correctly, that is the columns etc are all aligned. In my Data I have some special characters like German and French for names, Like for eg ( Väpp ) the Umlaut (..) on top of words. These look fine in the TXT file but when I look at the excel column, the name has weird characters in them. somethig like this ( Väpp ). I am on Excel 2007. I looked into the online help but couldn't find any place where these c...

illegal alias
Hi, I experience a stange issue, the user tata@exemple.com tried to send an email to toto@pp.com and he received this error message: "The message could not be sent because one of the recipients was rejected by the server. The rejected e-mail address was 'toto@pp.com'. Subject 'Test', Account: 'tata', Server: 'smtp.example.com', Protocol: SMTP, Server Response: '550 5.1.1 unknown or illegal alias 'toto@pp.com', Port: 25, Secure(SSL): No, Server Error: 550, Error Number: 0x800CCC79. But tata can send an email to another user titi@pp.com (ti...

Inserting character in a CEdit ctrl at a CPoint
Hi, I am using an edit ctrl as a multiline edit ctrl and would like the user to be able to hit the return key. Unfortunately my dlg is part of a DLL and the VK_RETURN message is not getting to my DLL (the preTranslateMessage does not get any hits). By feeding the message through from my main app by PostMessage to my parent dialog I am able to detect that the Return key has been hit and can narrow it down to which ctrl has hte focus. I can even narrow down to the location of the Caret when the Return key was hit. Unfortunately I cant work out how insert my character at this very locati...

How do I delete hidden character in Excel?
Hi, I have exported a table from Access 2000 to Excel 2000. However, all the fields have a hidden character in front which is ' I am unable to do any formulas as it doesn't recognise it as a number but has the number format. I can't get rid of it when doing a search and replace either. Can you help? Thanks. Isa, You could try using the CLEAN worksheet function. e.g. if your data is on Sheet1 create a new sheet and in Cell A1 of that sheet enter =CLEAN('Sheet1'!A1) and drag-copy that formula to an area the same size as the data on Sheet1. Having done that you may want ...

Excel getting closed giving an error message that some illegal operations occure
I am not able to open an excel file created by me. I created some macros in this book and later deleted all the macros. When I attempt to open the work book it says the following message: This program has performed an illegal operation and will be shut down. If the problem persists, contact the program vendor. EXCEL caused an invalid page fault in module EXCEL.EXE at 017f:3009f643. Registers: EAX=00002ffd CS=017f EIP=3009f643 EFLGS=00010216 EBX=0062ae52 SS=0187 ESP=006292e4 EBP=0062935c ECX=fc00001a DS=0187 ESI=0221c248 FS=408f EDX=0207000c ES=0187 EDI=025346e8 GS=3d76 Bytes at CS:EIP...

Upgrade path from 6.0 to 8.0? Fastest...
What is the fastest upgrade path from greatplains 6.0 to 8.0? I would rather not have to go through intermediate GP versions to upgrade the database. Is there a reliable way around this? Are there some utilities or docs to assist in this? thanks. Chris csiege@trimeris.com That path is not supported. You have to go through 7.5. Hopefully, you are at least on SQL Server. "trimer@community.nospam.com" wrote: > What is the fastest upgrade path from greatplains 6.0 to 8.0? > I would rather not have to go through intermediate GP versions > to upgrade the database. Is t...

illegal xml character
one night after i have finished my project on word07, i saved it in my USB flash disk. And on the next morning i would like to make some ammendments to it, i caouldn't open the file. It says, error occurs when opening the file. Detail information as follows: Illegal xml character. Position: wor/document.xml Row2 when happened?? i tried to open it after i have saved and it worked!! my file is extremely urgent!! could anyone please help, please !!! What has happened is a tough lesson. Never use Word (save or work) directly with any type of removable media. Always copy to...

Strange characters in new mail body
After I copied data from Excel into an email I get strange characters in the body of each new mail. This is somehow connected with Word since the problem goes away if I disable "Use Microsoft Word for writing email". If anyone knows a fix for this I would be grateful. -TH ...

character sets for non-English languages
We use an Access database to generate reports in Word. Often these are English and another language, side by side. Until some months ago, this worked very well. Now the special character sets needed for the other languages (Spanish, French, Portugese, German) appear as Greek symbols when the document opens in Word. This is computer-specific -- our database is on the network, and this problem has occurred in some computers at different times, but until a few weeks ago, never for all the computers. Now we can't generate the documents on any of our computers. Hi, try to ...

Illegal Operations
I am desperate for some help. Since yesterday, I get a message on my Outlook as so as I open it that it has performed an illegal operation. Details state that there is an invalid page fault in module MSO9.DLL@016f:308f3e51. The only day that I have 2 important e-mails to open and I can't get in. Does anyone have a suggestion??? Thanks, Bev Hi Bev, Read this for a start and see if it helps: http://support.microsoft.com/?kbid=241817 -Rob AttorneyCop.com >-----Original Message----- >I am desperate for some help. Since yesterday, I get a >message on my Outlook as s...

Excel variable for path
Excel variable for path I would like propose a variable in an excel cell and launch a word document from other excel cell Y:\document\%variable%\proof.doc , where %variable% can take several values. The taken value is proposed in an excel cell and seen. '[image: http://img40.imageshack.us/img40/8749/screenshot1251661545.jpg]' (http://img40.imageshack.us/i/screenshot1251661545.jpg/) Any similar solution is also possible for me . Thankxxx -- Esgrimidor That requires coding. Not sure if you know how to do that in Excel or not... the resulting open would be "Y:\docum...

Need to add the path to my document
I need to figure out how to add where my document is stored onto the bottom of my documents automatically Hi, In XL2003... Select View, then Header and Footer. Select the Header/Footer Tab then select your path from the Footer drop down list. Click OK and that's you done. Hope this helps, Gav "anita67" wrote: > I need to figure out how to add where my document is stored onto the bottom > of my documents automatically ...

Error in equation 'Illegal syntax' when printing
I've got a user with a new laptop. GP is installed & has been working fine. Today he tried to print a job cost report (to printer and to screen) and gets a pop up window with 'Error in equation '*** ILLEGAL SYNTAX *** [] [Not Found] '. He has the dept. standard printer set up on his PC. I tried printing the job cost report from my PC and it prints fine, so it's not the job. I tried printing a different job from his PC, same problem. I tried using a different printer from his PC, same problem. So it's clearly something with a GP install file. I'm g...

Typing Portuguese characters
I'm running OE 6.0 on a W98 platform. In all other programs, I can hit a string of keys to get Portuguese characters (eg, "alt" + "," + "c" give me a "c" with a cedille under it). However, in Outlook, this doesn't work. When I used Outlook 5.5 on W95, the key stroke sequence for W95 for these characters did work. Can someone tell me how to type these characters without a Portuguese keyboard? Thanks This newsgroup is for support of Outlook 97-2003 from the Office family for Windows PCs. For Outlook Express (OE) support try posting in one of th...

Creating an account with special characters, like & in the name
Hi I'm using CRM 1.2 SDK and trying to import my data to CRM. Some of my accounts contain & in the name (of cource :-) ) But I fail in my Account.Create ... My code works fine with regular names, and I also managed to query whether an account like that exists (using like %...). Anyone knows how to do that? I tried "<account><name>A && B</name><ownerid type=\"8\">{6E8835EF-61E2-4E11-8DAB-D5A13C3E0A34}</ownerid></account>" and also "<account><name>A \& B</name><ownerid type=\"8\"...

Extend field with Thai characters
How can i extend a field with Thai characters. Please help ...

Character sort order ?
I have been trying to make sense out of how XL sorts my text. The help file is clear on this ... and yet it sorts "[" before "1" (which is not the stated default order). So ... apart from special defined lists, is there an option to turn this default order off ... or to change it in some way ? ... or am I missing something really simple here ? :) Thanks Bruce ---------------------------------------- I believe you find life such a problem because you think there are the good people and the bad people. You're wrong, of course. There are, always and only, the bad...

How to find out the path where the exe is located?
I have to create a file in the directory where the program itself is located, but I cannot find any function that would give the path. Any suggestion? I only find things that give the path of the current directory, but that is no good.... Thanks. ZPenzes "ZPenzes" <zpenzes@yahoo.com> wrote in news:3fb553b6@andromeda.datanet.hu: > I have to create a file in the directory where the program itself is > located, but I cannot find any function that would give the path. Any > suggestion? I only find things that give the path of the current > directory, but that is ...

the last one to three characters of Y-axis label cannot be display
I am using Sony VAIO laptop (Model PCG-K23). The y-axis labe cannot be display fully in Excel 2003, Excel XP, and even Excel Work that came with this laptop. The Sony customer care guys attribute this problem to MS software problem. Does any one know how I can solve this problem? I have updated my Office2003, Window XP, and even graphic driver (ATI Radeon IGP). ...

Help on unicode characters in Linux
Hello, This question will seem very silly to most, but I am very new to Unicode. I have a simple requirement. Assuming I have a text file containing chinese characters, I need to read these characters with my C code, and be able to write them to a different file without any data corruption. On my system, the locale has been set to UTF and I am able to view the chinese characters. In order for my code to be able to read and process these characters, what do I need? Regards. ...

Illegal Operation
First, thanks in advance for any assistance you can give me with this problem When I try to start outlook express I get a message saying: "This program has performed an illegal operation & will be shut down" After pressing details I get: "MSIMN caused an invalid page fault in module MSOE.dll at 016f:007c5c01".....etc I went to the outlook pages at Microsoft and followed the directions there and still have the same problem. The site tells me to check the properties on all the dbx files and make sure that the read-only box is not check...

character limit per cell
Hi I have an end user who is trying to word wrap a lot of text in a single cell (1,152 characters including spaces) but the text isn't word wraping the very last line. Is there a limit to the number of characters per cell or is there another problem that I don't know about? I've tried all the usual fixes without any luck Any help appreciated Keith Hi the maximum is 1024 characters per cell. You can extend this by manually entering linebreaks with ALT+ENTER >-----Original Message----- >Hi, > I have an end user who is trying to word wrap a lot of text in a single cell...

Is the apostrophe ' an allowed character in an email address?
Is the apostrophe ' an allowed character in an email address? -- Spin I don't believe so. Nue "Spin" <Spin@spin.com> wrote in message news:49hs58Fobp2iU1@individual.net... > Is the apostrophe ' an allowed character in an email address? > > -- > Spin > > Yes it is. I have various Irish guys with name.o'halloran@main.com setup and it works fine. "Spin" <Spin@spin.com> wrote in message news:49hs58Fobp2iU1@individual.net... > Is the apostrophe ' an allowed character in an email address? > > -- > Spin...

Illegal Syntax
Since my upgrade to v9 (.301) my users have been getting an "Error in equation '*** ILLEGAL SYNTAX" type error when printing some of our customized reports. I have tried recreating the reports.dic but this error still occurs and there is not help in any KB. Anyone else have this problem or know of a potential cause or solution? Thanks! MAC Hi Mac. What reports are you getting this error on? Some modifed reports do not upgrade, and you will have to modify them from scratch in V9. If you hAve your V9 CD's, you can find a list of the reports that won't upgrade. Loo...