473,394 Members | 1,889 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

problem in XML file while converting to string........

hi all,

i have a xml file.I have converted the xml file to String using
OuterXml....... now i am getting like this
"<ClientList><Client
action=\"Modify\"><ClientID>nokia</ClientID><FullName>Raj</FullName><AccountNo>12345</AccountNo><Type>Individual
</Type><Source>By client referral
</Source><Status>Bad
</Status><Industry>Marketing
</Industry><Info><![CDATA[Some
Text]]></Info><Logo></Logo><ClientAdditionalInfo><ClientId></ClientId><Text1></Text1><Text2></Text2><Text3></Text3><Text4></Text4><Text5></Text5><Text6></Text6><Text7></Text7><Text8></Text8><Text9></Text9><Text10></Text10></ClientAdditionalInfo><AddressList><Address
action=\"add\"><FirstName>sam</FirstName><Street>343,fddf,fdf,\r\ndfd</Street><State>hghghg</State><City>fdf</City><Country>China</Country><PostCode>kui</PostCode><Zone>100
</Zone><LocationInfo>ghghk jyjuy
yjyj</LocationInfo><Remark>hjgghghghg</Remark><XMapPos></XMapPos><YMapPos></YMapPos><XRtPos></XRtPos><YBotPos></YBotPos><ContactList><ContactInfo
action=\"add\"><ContactId></ContactId><ContactIdType>Name</ContactIdType><ContactFor>Address</ContactFor><ForId>3A6D7D9A48F84A64A4B451A3B7771158 </ForId><ContactName></ContactName><ContactNo>23232354545</ContactNo></ContactInfo><ContactInfo
action=\"add\"><ContactId></ContactId><ContactIdType>Phone</ContactIdType><ContactFor>Address</ContactFor><ForId>3A6D7D9A48F84A64A4B451A3B7771158 </ForId><ContactName></ContactName><ContactNo>23232354545</ContactNo></ContactInfo><ContactInfo
action=\"add\"><ContactId></ContactId><ContactIdType>Cellular</ContactIdType><ContactFor>Address</ContactFor><ForId>3A6D7D9A48F84A64A4B451A3B7771158 </ForId><ContactName></ContactName><ContactNo>23232354545</ContactNo></ContactInfo><ContactInfo
action=\"add\"><ContactId></ContactId><ContactIdType>Email</ContactIdType><ContactFor>Address</ContactFor><ForId>3A6D7D9A48F84A64A4B451A3B7771158 </ForId><ContactName></ContactName><ContactNo>23232354545</ContactNo></ContactInfo></ContactList></Address></AddressList></Client></ClientList>"
i want to remove those backslash and double quotes which appear in
action tag(like <Client action =\"Modify\">) in the xml........ plz
help to solve this problem.....
how can i do that ....... i searched for ascii function in C# but found
nothing......

pls help me to solve the problem....
Thanking you in advance.....
with regards,
Sridev

Dec 1 '05 #1
5 2330
>i want to remove those backslash and double quotes which appear in
action tag(like <Client action =\"Modify\">) in the xml........ plz

- you cannot remove the double quotes, or you will make the xml
illformed
- the OuterXml does not contain backslashes. You only see backslashes
in debugger's windows (like Watch or Command). These windows display
values as they are declared in code. It already includes double quotes
arround the string, so it add backslashes for embeded double quotes for
the sake of clarification.

Thi

Dec 1 '05 #2
hi,

Thank you Truong for your solution......... Actually i want it to
remove because i am storing the string into database using COM which
was written in VC++.When i give the string to the COM for saving the
string into database it generates error like this

Exception Details: System.Runtime.InteropServices.COMException:
Exception from HRESULT: 0x80040E14.

Source Error:
Line 475:
Line 476:
String strClientxml="";

Note: Line 477: strClientxml=objClient.Save(strCondb,strXml);
// error in this line

Line 478: Debug.WriteLine(strClientxml);
Line 479: }
Source File: e:\optimate.net\client\insclient.aspx.cs Line: 477

Stack Trace:
[COMException (0x80040e14): Exception from HRESULT: 0x80040E14.]
SPSCOMLib.DCOMClientClass.Save(String bstrConnString, String strXML)
+0
Op.Net.Client.Temp.btnNext_Click(Object sender, EventArgs e) in
e:\op.net\client\insclient.aspx.cs:477
System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
System.Web.UI.Page.ProcessRequestMain()
So i thought that because of that backslah and double quotes its not
getting saved.............. If you know the solution for this plz let
me know that...........

Thank you once again.......

with regards,
Sridev

Dec 1 '05 #3
There should be a problem with your COM's Save method.
In .NET, you should use parameter instead of string concatenation to
ensure the xml string be escaped correctly.
I am not sure about VC++, but you may need to make use of something
similar to ensure the xml text is sanitized.

Thi

Dec 1 '05 #4
hi Thi,

Thank you for ur solution..........

with regards,
Sridev

Dec 1 '05 #5
Hi Thi,

I got the result ......... Thank you for ur great help.

With Regards,
Sridev

Dec 1 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Nimmi Srivastav | last post by:
Brief:- I am having trouble getting a FileWriter to write to a non-existent file if I instantiate the FileWriter with a String that is manipulated at run time. It works fine with a hard-coded char...
0
by: | last post by:
I'm trying to scan a (binary) file for a string matching a particular pattern, and am getting unexpected results. I don't know if this is a bug or just my own misunderstanding of regular...
4
by: kalio80 | last post by:
Hi everyone I posted an enquiry earlier about using c++ code to convert text files between linux & widows. I ended up with this code: #include <iostream> #include <fstream> using namespace...
3
by: Colin J. Williams | last post by:
Python advertises some basic service: C:\Python24>python Python 2.4.1 (#65, Mar 30 2005, 09:13:57) on win32 Type "help", "copyright", "credits" or "license" for more information. >>> With...
3
by: Joshua Russell | last post by:
Hi, I've got a program (see source below) that makes a file and fills it with random binary values (from 0 to 255). The source below works, however the program creates files at a rate of about...
2
by: RP2001 | last post by:
I've serialized in various variables of various types (mainly CString, int, double) into an instantiated MFC CArchive class and saved it as a binary file. I am able to open the binary file and...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
12
by: Adam J. Schaff | last post by:
I am writing a quick program to edit a binary file that contains file paths (amongst other things). If I look at the files in notepad, they look like: ...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
0
by: anide | last post by:
Hi all I’ve some problem, I’m trying to converting a sorting algorithm from C++ to C#. In C++ I’ve compiled it using MSVC and its working properly, and in C# I’m using .NET Framework 2.0 (Visual...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.