473,414 Members | 1,772 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,414 software developers and data experts.

Question about XmlDocument->Save method

Dear Colleagues,

i'm developing a C++ .NET based application that works with System.Xml
library.

My problem appears when i try to save a document througt
XmlDocument->Save method, because it seems to add some strange
characters at the beginning of the saved XML document.

For instance, if first i print the document throught System::Console
class, the output is:

ini...<?xml version="1.0" encoding="UTF-8"?><ls:Empresa
xmlns:ls="uri:LeanSi (...)

where i've printed "ini..." string in order to test that no strange
simbol is included at the beginning of the XML document, contained in
InnerXml property of XmlDocument.
But when i save the same document througt XmlDocuemnt->Save, the saved
document contains:

<?xml version="1.0" encoding="UTF-8"?><ls:Empresa xmlns...

Do you know why the library adds "" ? This string is added in every
XmlDocument that i try to save.

Thanks,

Francesc

Jul 20 '05 #1
1 2429


Francesc Guim Bernat wrote:
Dear Colleagues,

i'm developing a C++ .NET based application that works with
System.Xml library.

My problem appears when i try to save a document througt
XmlDocument->Save method, because it seems to add some strange
characters at the beginning of the saved XML document.

For instance, if first i print the document throught System::Console
class, the output is:

ini...<?xml version="1.0" encoding="UTF-8"?><ls:Empresa
xmlns:ls="uri:LeanSi (...)

where i've printed "ini..." string in order to test that no strange
simbol is included at the beginning of the XML document, contained in
InnerXml property of XmlDocument.
But when i save the same document througt XmlDocuemnt->Save, the
saved document contains:

<?xml version="1.0" encoding="UTF-8"?><ls:Empresa xmlns...

Do you know why the library adds "" ? This string is added in
every XmlDocument that i try to save.


It is probably a byte order mark, it is not necessary with UTF-8 but
allowed.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

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

Similar topics

2
by: Tom Pearson | last post by:
I have created an XmlDocument and can see that this is correctly formed and has a root element If I Save the doc to a file and reload it all works o If I dump the doc to a stream, again using the...
0
by: Amendra | last post by:
Hi, Currently we are using the .NET XMLDocument Class to manipulate some xml documents. The issue we are having is that when we save the XML files using the classes save method, empty xml tags...
1
by: st | last post by:
Hi, I'm using xmlDocument.Save(xmlTextWriter) to create an Excel-readable file. All works well, except where I've replaced the carriage return chars in the .innertext to XML-compliant " "; It...
4
by: Carl Williams | last post by:
Hope someone can help with this... I have looked at all the newsgroup articles and put into practice all the suggestions but to no good. I am pretty new to CSharp and .Net so any help would be...
2
by: Terry | last post by:
When using XMLDocument.Save(strFileName) in .NET 2005, is there a way to check (or trap) and see if the file is in use by another. I am using VB.NET. Currently it just bombs and says the filename...
1
by: liuhengyi | last post by:
Hi, I have a test program that creates 5 threads and each thread uses XmlDocument.Save(filename) to save a Xml dom to a file. I have put the lock statement around the Save to prevent from...
0
by: liuhengyi | last post by:
Hi, I have a test program that creates 5 threads and each thread uses XmlDocument.Save(filename) to save a Xml dom to a file. I have put the lock statement around the Save to prevent concurrent...
3
by: Aaron Sellers | last post by:
Hi all, I have a nicely formatted .xml file that loses that nice formatting when I edit it and use XmlDocument.Save to save the file. Does anyone know of any way to keep the formatting I had when...
1
by: Daniel | last post by:
what encoding does system.xml.xmldocument.save(string path) use to save the xml document if there is no <?xml... in the front of the xml document?
3
by: Stephen Ward | last post by:
I have a simple little project open a xml file change a few nodes save the file, no big deal. The problem is that the doctype is getting modified when I save the file. So it looks like this:...
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.