473,796 Members | 2,583 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Extra Backslash After LoadXML

How do I eliminate an extra backslash that is appearing after LoadXML
call?
This issue is causing an error with Process.Start.

I have a string stored in sql: c:\program files\internet
explorer\iexplo re.exe

If I look at this data when I write the dataset to an XML file, the
data is correct.

After the LoadXML call, the data is hosed.

Notice in my commandlocation node, all of the backslashes are doubled.

I don't know if the problem is in the ds.GetXml() call or the
xd.LoadXml() call.
"<NewDataSe t>
<VendorAction >
<commandlocatio n>c:\\program files\\internet
explorer\\iexpl ore.exe</commandlocation >
<commandargumen ts>http://ServerName/mm/integration/con...x?PatientName=
{PatientName}
</commandargument s>
<commanddescrip tion>Launch SmartID Works Oncology
Product</commanddescript ion>
</VendorAction>
</NewDataSet>"
My code:
//Add the parameter to the Command's Parameters
collection
cmd.Parameters. Add(vaid);

// Create the DataSet & DataAdapter
SqlDataAdapter da = new SqlDataAdapter( );
da.SelectComman d = cmd;
DataSet ds = new DataSet();
da.Fill(ds, "VendorAction") ;

// Write DataSet as XML file
ds.WriteXml(@"C :\VAIDOutput.xm l");
*** Data Correct Here ***
// Load DataSet as XML document to return to caller
xd.LoadXml(ds.G etXml());
conn.Close();
*** Data Error Here ***

If I use double backslashes in the original string in sql:
c:\\program files\\internet explorer\\iexpl ore.exe

then the result from the LoadXml call is quadruple backslashes:
c:\\\\program files\\\\intern et explorer\\\\iex plore.exe

Where and how should this be changed

Nov 14 '06 #1
2 2873
binder wrote:
How do I eliminate an extra backslash that is appearing after LoadXML
call?
This issue is causing an error with Process.Start.

I have a string stored in sql: c:\program files\internet
explorer\iexplo re.exe

If I look at this data when I write the dataset to an XML file, the
data is correct.

After the LoadXML call, the data is hosed.

Notice in my commandlocation node, all of the backslashes are doubled.
Are you sure the backslashes are duplicated? What you experience seems
to be just the way the IDE/debugger shows string literals where
backslashes need to be escaped as "\\".


--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 14 '06 #2
The string that has the double backslashes contains the path to the IE
executable.
I am loading a ProcessStartInf o structure with the result string to
launch an instance of IE. The Process.Start call is failing because
iexplore.exe can't be found.
Martin Honnen wrote:
binder wrote:
How do I eliminate an extra backslash that is appearing after LoadXML
call?
This issue is causing an error with Process.Start.

I have a string stored in sql: c:\program files\internet
explorer\iexplo re.exe

If I look at this data when I write the dataset to an XML file, the
data is correct.

After the LoadXML call, the data is hosed.

Notice in my commandlocation node, all of the backslashes are doubled.

Are you sure the backslashes are duplicated? What you experience seems
to be just the way the IDE/debugger shows string literals where
backslashes need to be escaped as "\\".


--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 14 '06 #3

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

Similar topics

10
1736
by: Tank | last post by:
First off let me say that I am by no means a skilled programmer so i probably have made a dozen mistakes in my attempt at coding my problem. I will tell you the problem so that you have an idea of what i am trying to do and I will give you my code so you can see my clusterf*ck. Here is the problem: At work I have about 20 photographers who work for me. Each one has a photo idea number (mine is 102 and my bosses is 101 and my...
1
2067
by: Matt Bush | last post by:
Using .NET Framework 1.1 and Visual Studio .NET 2003. Language is VB.NET. When loading an XML String using XMLDocument.LoadXml we are getting an extra space inserted into abbreviated end tags: objXmlDoc.XmlResolver = Nothing objXmlDoc.LoadXml(XmlData) .... .... objXmlDoc.InnerXml (gets written to database)
6
18768
by: jmgonet | last post by:
Hello everybody, I'm having troubles loading a Xml string encoded in UTF-8. If I try this code: ------------------------------ XmlDocument doc=new XmlDocument(); String s="<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?><a>Schönbühl</a>"; doc.LoadXml(s); doc.Save("d:\\temp\\test.xml");
4
2250
by: martin | last post by:
Hi, I am copying an xml file like so. Dim xmlDoc As New XmlDocument xmlDoc.Load("C:\Program Files\Templates\message.msg") Console.WriteLine("Tmaplate loaded") xmlDoc.Save("C:\Program Files\Templates\copy.xml") Console.WriteLine("message saved")
3
2723
by: rasx | last post by:
I get this error when I fail to ‘clean up’ my UTF-8 MemoryStream: “Invalid at the top level of the document. Error processing resource…” Visual Studio 2005 in debug mode shows well formed XML “prepended” with a character represented by an empty rectangle and trailed with a series of backslash zeros (\0). These are the lines of code that solve this problem: s = s.Trim(); s = s.Replace("\0", String.Empty); The Trim() gets...
0
1103
by: binder | last post by:
How do I eliminate an extra backslash that is appearing after LoadXML call? This issue is causing an error with Process.Start. I have a string stored in sql: c:\program files\internet explorer\iexplore.exe If I look at this data when I write the dataset to an XML file, the data is correct.
3
23018
by: Stef Mientki | last post by:
It looks like sometimes a single backslash is replaced by a double backslash, but sometimes it's not ??? See the error message below, the first backslash is somewhere (not explicitly in my code) replaced, but the second is not ??? Is it in general better to use double backslash in filepaths ? thanks, Stef Mientki
2
2185
by: Tobiah | last post by:
>>"'" "'" "'" "\\'" "\\'" This is quite different than any other language that I am used to. Normally, a double backslash takes away the special meaning of the last backslash, and so you are left with a single backslash.
5
15696
by: vlsidesign | last post by:
The printf function returns "warning: unknown escape sequence: \040" for a backslash-space combination. If the ascii decimal number for space is 32 and the backslash is 92, why this particular number 040? Is it a decimal number from the ASCII code chart? (compiling using gcc on SunOS 5.8, Sparc, Ultra-80) Just curious. Thanks.
0
9528
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10455
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10173
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10006
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6788
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.