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

Adding SchemaReference in the XML file generated by Serialization

Hello all,

How do i add the schema reference in the XML file generated by XMl
Serialization.

My generated XMl file should have the following attribute in the Root
Element.
<Root Element xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="Dummy.xsd">

I want the xsi:noNamespaceSchemaLocation the following to be present in the
XML file.

TIA

Manoj
Nov 11 '05 #1
2 1509
Manoj,

Simply include a field in the class that writes out the attribute:
public class Root
{
[XmlAttribute( Namespace=""http://www.w3.org/2001/XMLSchema-instance")]
public string noNamespaceSchemaLocation="Dummy.xsd";

// all your other fields ...
}

--
HTH
Christoph Schittko [MVP]
Software Architect, .NET Mentor

"Manoj Shirahatti" <ma**************@in.bosch.com> wrote in message
news:bj**********@ns2.fe.internet.bosch.com...
Hello all,

How do i add the schema reference in the XML file generated by XMl
Serialization.

My generated XMl file should have the following attribute in the Root
Element.
<Root Element xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="Dummy.xsd">

I want the xsi:noNamespaceSchemaLocation the following to be present in the XML file.

TIA

Manoj

Nov 11 '05 #2
Thanks for the info. It solved my problem.
Nov 11 '05 #3

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

Similar topics

1
by: Phil Price | last post by:
Hi there, I'm developing a shape recognition application for the tablet PC for a) fun b) university project. Currently I'm working on the learning stage using neural networks, and have to store...
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: Dave | last post by:
Hi, If anyone could help with this, I would greatly appreciate it! I've created my own WSDL file and referenced an XSD file too. I've generated a service side interface using wsdl /server, and...
4
by: Peter Kryszak | last post by:
I was given a couple of XSD files so that I could generate a client that targeted a SOAP/RPC web service. One of the XSDs includes a definition of an element that is a sequence of row elements,...
2
by: mudge | last post by:
Hi, I'm getting some very strange problems with some C# code. We're running an ASP.NET application on a local server in a DMZ. If I access it using the internal address, the application works...
3
by: Roy Chastain | last post by:
I have a schema that has been in existence over 1 year. I have been making a few minor modifications to it recently and suddenly the generated C# classes have made a radical change. I have just...
5
by: =?Utf-8?B?TmF0aGFuIFdpZWdtYW4=?= | last post by:
Hi, We have an app that uses XML serialization throughout. As everyone probably knows, using XML serialization is not always a good idea in a big project...
0
by: Benjamin Kalytta | last post by:
Hello there, is there a way to override predefined Serializer for LINQ to SQL class objects? MSLinqToSQLGenerator generates classes for accessing Database. I want to create a Webservice...
2
by: compurhythms | last post by:
I have a .NET Windows Service that needs to run without interruption for long periods of time (weeks or months). Everything works great except that every once in a great while I get the following...
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
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
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...
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
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 project—planning, coding, testing,...
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.