473,408 Members | 2,839 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,408 software developers and data experts.

Qualify namespace while serializing

Hello all,

I am starting on a new project at work using XML and C#, and am new to
C#. I am attempting to serialize a class to an XML file, and am coming
across a problem that I hope someone can help with. I've spent the
better part of a few hours researching the problem and can't seem to
find a solution.

Below is a sample of the XML that is output when I serialize my class.
As you can see, there is an element called <City Description>.

<?xml version="1.0" encoding="utf-8" ?>
- <Address xmlns:Address="Address:City"
xmlns="http://www.xmllegal.org/Address/02/">
<City Description>Test12</City>
</Address>
This is fine, but the problem I am having is that I need to qualify the
element names with the "Address" namespace. For example...

<City Description>

should be....

<Address:City Description>

I've attempted to use the XmlSerializeNamespaces, but that only places
the namespace at the top of the XML, and does not qualify the element
names with the namespace. Could someone tell me how you go about
qualifying the elements with a namespace, or point me in the right
direction?

Sincere thanks in advance.

Chris Olson

Nov 12 '05 #1
0 865

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

Similar topics

1
by: Bill Geake | last post by:
I am successfully serializing to XML from a class like this: private static void CreateXML() { testClass c = new testClass(); c.stringElement = "data1"; c.stringElement2 = "data2"; ...
0
by: Alberto Grosso Nicolin | last post by:
We have the following XML schema: there's a root element (Response) with of a single child element (Result). ...
5
by: StephenRichter | last post by:
I have a base class: namespace ac { public class BasePage : System.Web.UI.Page { private string mPageTitle ; private string mPageUrl ; public BasePage( ) {
0
by: farseer | last post by:
Hi, I am asking this here in addition to the vstools.office group because i think the issue could possibly be schema or serilazation related... i have a word document which has a custom schema...
5
by: karim | last post by:
I am getting the error below when I try to use DataRowView in my aspx page. I am using the System.Data in my code behind. I even tried importing system.Data in the aspx. I have to qualify it with...
2
by: Mike Fiedler | last post by:
On a client web services request, I have a SoapExtension that is adding a header to the message in the BeforeSerialize stage. If the Web Service request is for an operation with...
2
by: scottpet | last post by:
Hi, I want to add a namespace prefix to the root node of an object I am serializing to XML. I have been reading though this article:...
9
by: Mark Olbert | last post by:
I'm trying to serialize (using XmlSerializer.Serialize) a class that I generated from an XSD schema using XSD.EXE /c. The problem I'm running into is that the root element needs to be unqualified,...
8
by: Jack | last post by:
Hi, I have a single class XXX residing in a namspace with the same name: XXX. I can access my class in my code just fine with: XXX.XXX.MySub() '(Note: shared sub!) But I don't want to...
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: 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
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.