sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
Mori's Avatar

need help parsing text to get xml


Question posted by: Mori (Guest) on November 12th, 2005 05:08 AM
I have a string that contains the \", \t, \r, \n. I need to get the xml.

sample below:
"<?xml version=\"1.0\"?>\r\n<USERS
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xmlns=\"http://www.slcorp.com\\xml\\slcorp_dtd_schema.xml\">\r\n\t<ACCT>GameTek</ACCT>\r\n\t<USER>\r\n\t\t<USER_ID>Mike</USER_ID></USER>\r\n\t</USERS>\r\n"

I have tried replacing as follows so I can get the xml. I have tried 2
approaches
(1)
str = str.Replace("\n", "").Replace("\t","").Replace("\r","").Replace("\"",
""");
This code segment (Replace("\"", """);) does not compile, the rest is okay.
-------------------------------------------------------------------------
(2)
I have also tried using Regex as follows

string str= Regex.Unescape(str); This time the exception is "Insufficient
hexadecimal digits"


Any ideas?
0 Answers Posted
 
Not the answer you were looking for? Post your question . . .
196,829 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 196,829 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Community Contributors