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

prohibiting serializer from writing namespace info

I have an xml string which do not contain xml decl or any namespace info.
Even the schema that generated the class only contained XMLSchema namespace
only.

Whenever the object gets serialized, the xml file contains the xml decl and
the schema namespace information.
I don't mind the decl statement but I do mind the schema namespace info. Is
there any way to suppress it?

<?xml version="1.0" encoding="utf-16"?>
<myroot xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />

should simply be:
<?xml version="1.0" encoding="utf-16"?>
<myroot/>

or better yet:

<myroot/>

Thanks in advance.
Jiho
Nov 12 '05 #1
2 1026
Jiho Han wrote:
I have an xml string which do not contain xml decl or any namespace info.
Even the schema that generated the class only contained XMLSchema namespace
only.

Whenever the object gets serialized, the xml file contains the xml decl and
the schema namespace information.
I don't mind the decl statement but I do mind the schema namespace info. Is
there any way to suppress it?

<?xml version="1.0" encoding="utf-16"?>
<myroot xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />


FAQ, http://groups.google.com/groups?thre...%40tkmsftngp10
--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com
Nov 12 '05 #2
Thanks Oleg as always and I apologize for my pure laziness! :P

"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> wrote in message
news:uK**************@TK2MSFTNGP10.phx.gbl...
Jiho Han wrote:
I have an xml string which do not contain xml decl or any namespace info. Even the schema that generated the class only contained XMLSchema namespace only.

Whenever the object gets serialized, the xml file contains the xml decl and the schema namespace information.
I don't mind the decl statement but I do mind the schema namespace info. Is there any way to suppress it?

<?xml version="1.0" encoding="utf-16"?>
<myroot xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
FAQ,

http://groups.google.com/groups?thre...%40tkmsftngp10

--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com

Nov 12 '05 #3

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

Similar topics

0
by: Mark | last post by:
Hi all, i'm trying to serialize a class. Using the constructor of XmlSerializer i get these (odd?) errors: "File or assembly name goseij9w.dll, or one of its dependencies, was not found"....
5
by: Tappy Tibbons | last post by:
I have a class I am serializing, and need the resultant XML to skip/omit classes that are not initialized, or their member variables have not been set. Is this possible? Say for the following...
1
by: Marty McDonald | last post by:
I created business entity classes using XSD.exe. In code I've populated my dataset. Now, I want to put that data into the entity class. Do I use DataSet.WriteXml() to a memorystream, then pass...
3
by: Mark | last post by:
Hi all, i'm trying to serialize a class. Using the constructor of XmlSerializer i get these (odd?) errors: "File or assembly name goseij9w.dll, or one of its dependencies, was not found"....
1
by: Michael A. Covington | last post by:
Is there an easy way to insert an encryption routine in between the XML serializer and the file it is writing or reading?
6
by: Wilfried Mestdagh | last post by:
Hi, I use this class to save application settings in a xml file. Sometime I have exception error in the Load method, and sometime in the Save method. Is this a bug in NET or is there something I...
8
by: Q. John Chen | last post by:
I have following code: public class Member { public string FirstName; public string LastName; public string GetXml() { StringBuilder sb = new StringBuilder(); XmlSerializer serializer
1
by: hawkeye.parker | last post by:
using .net 1.1 i think i might want to replace the xml serializer which my .Net webservice uses with a custom serializer. anyone know: a) is this possible? b) if so, is it terribly difficult...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.