473,770 Members | 2,519 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

xsi:noNameSpace SchemaLocation

Hi,

I am creating C# calsses to seralize and deserialize based on xsd.

When defining the classes to do seralization i need to specify the
schema for the reference. Typically my class definition looks like this
:

[XmlRootAttribut e(NameSpace = "", IsNullable=fals e)]
public class MyClass
{
public string myString;
}

I need to specify xsi:noNameSpace SchemaLocation somewhere in the
XmlRootAttribut e. Please help me....

Regards

Balaji. V
=============

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 11 '05 #1
1 7895
Balaji V wrote:
I am creating C# calsses to seralize and deserialize based on xsd.

When defining the classes to do seralization i need to specify the
schema for the reference. Typically my class definition looks like this
:

[XmlRootAttribut e(NameSpace = "", IsNullable=fals e)]
public class MyClass
{
public string myString; I need to specify xsi:noNameSpace SchemaLocation somewhere in the
XmlRootAttribut e. Please help me....

Add dummy field to your class and serialize it as desired attribute:
[XmlAttribute(At tributeName="no NamespaceSchema Location",
Namespace="http ://www.w3.org/2001/XMLSchema-instance")]
public string noNamespaceSche maLocation = foo.xsd";

--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #2

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

Similar topics

0
1807
by: Lindy | last post by:
I'm using VB .Net and am new to XML. I need to create an XML file with the following lines: <?xml version="1.0" encoding="UTF-8" ?> - <HC_DATA xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://.../asc.xsd"> other stuff... </HC_DATA>
0
1502
by: Lindy | last post by:
I'm using VB .Net and am new to XML. I need to create an XML file with the following lines: <?xml version="1.0" encoding="UTF-8" ?> - <HC_DATA xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://.../asc.xsd"> other stuff... </HC_DATA>
1
2323
by: Tjerk Wolterink | last post by:
Who can learn me the difference between the these two attributes: xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation and xsi:noNamespaceSchemaLocation
0
4565
by: jr | last post by:
Hello, I have got a schema file "myschema.xsd" from my customer for which I must create xml files. I used xsd.exe to create a class for the schema. I fill an object for that class with data and serialize it. My customer gave me an example xml file, how it should look like, and it begins with <?xml version="1.0" encoding="UTF-8"?>
1
7797
by: AP | last post by:
Hi, I'm getting the following error trying to validate an xml document against a schema: The 'xsi:noNameSpaceSchemaLocation' attribute is not declared My xml file looks like this: <?xml version="1.0" encoding="utf-8"?> <TitleNotification xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" d1p1:noNameSpaceSchemaLocation="http://www.pdr.com&#xA;https://extw3c.pdr.co...
3
6750
by: Mark Jerde | last post by:
I've been looking through MSDN, books and googling for a couple hours but haven't found the solution yet. I'm using CSharp in VS .NET 2003. I'm trying to use XmlDocument to save XML files that are valid to a schema I've developed. I want the root element to look like this: <TestCase xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="TestCaseSchema_03.xsd"> I've tried several variations of...
1
7822
by: Craig | last post by:
Hi there, I'm generating an XML script using ElementTree which has the following attributes in the root element: <CANmessages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="code/can.xsd"> My python script I have written is:
2
2480
by: =?ISO-8859-1?Q?Jean=2DFran=E7ois_Michaud?= | last post by:
Hello guys, I was wondering if it was possible to disregard the xsi:noNamespaceSchemaLocation. For validation it's obviously easier to have it point to say a local directory but the final xsi:noNamespaceSchemaLocation has to point to a specific location that is not local. I was wondering if it was possible to make sure that the xsi:noNamespaceSchemaLocation points to the non local location, force the parser to disregard the...
3
5418
by: Samuel | last post by:
I use the following code to create the XML from a class object Dim serialize As New System.Xml.Serialization.XmlSerializer(GetType(XYZObject)) serialize.Serialize(obWtiter, obObject) But I need the following ' xsi:noNamespaceSchemaLocation="obj-envelope.xsd"' to be included in the in the main opening tag
0
9592
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
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
10230
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...
0
9870
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
8886
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, and deployment—without 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...
1
7416
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2817
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.