473,788 Members | 3,101 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

(XmlSchema->targetNamespac e) error while writing xsd

Hello,

I am trying to write an xsd file using .NET System.Xml.Sxhe ma Class Library.

(1) I get an error while writitng if the XSD has a taregetnamespac e.
(II) for any xsd with no targetnamespace the program works fine.

I want to create an xsd with the following namespaces

<xsd:schema targetNamespace "http://www.homedepot.c om/HD"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:hd="http://www.homedepot.c om/HD">

Following is the code

XmlSchema* schema = new XmlSchema();
XmlNamespaceMan ager* nsmgr = new XmlNamespaceMan ager(new NameTable());
nsmgr->AddNamespace(" xs", "http://www.w3.org/2001/XMLSchema");
nsmgr->AddNamespace(" hd", "http://www.homedepot.c om/HD");
schema->TaregetNamspac e = "http://www.homedepot.c om/HD";
System::IO::Fil eStream* fs = new FileStream("XSD Write.xsd",
FileMode::OpenO rCreate);
schema->Write(fs, nsmgr); ///UNKNOWN EXCEPTION WHILE writing

(111) Is there a limitation that the targetnamespace cannot be in the
namespace manager???
I am unable to find out the problem here

Thanks,
Maansi




Nov 17 '05 #1
1 1346
Maansi,

must be something else in your code. I just tried it out (fixing the syntax
errors) and it worked just fine, no exception.

--
Tomas Restrepo
to****@mvps.org
http://www.winterdom.com/
"Maansi Sanghi" <ma**********@a bosoftware.com> wrote in message
news:O2******** ******@tk2msftn gp13.phx.gbl...
Hello,

I am trying to write an xsd file using .NET System.Xml.Sxhe ma Class
Library.

(1) I get an error while writitng if the XSD has a taregetnamespac e.
(II) for any xsd with no targetnamespace the program works fine.

I want to create an xsd with the following namespaces

<xsd:schema targetNamespace "http://www.homedepot.c om/HD"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:hd="http://www.homedepot.c om/HD">

Following is the code

XmlSchema* schema = new XmlSchema();
XmlNamespaceMan ager* nsmgr = new XmlNamespaceMan ager(new NameTable());
nsmgr->AddNamespace(" xs", "http://www.w3.org/2001/XMLSchema");
nsmgr->AddNamespace(" hd", "http://www.homedepot.c om/HD");
schema->TaregetNamspac e = "http://www.homedepot.c om/HD";
System::IO::Fil eStream* fs = new FileStream("XSD Write.xsd",
FileMode::OpenO rCreate);
schema->Write(fs, nsmgr); ///UNKNOWN EXCEPTION WHILE writing

(111) Is there a limitation that the targetnamespace cannot be in the
namespace manager???
I am unable to find out the problem here

Thanks,
Maansi



Nov 17 '05 #2

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

Similar topics

1
6098
by: Heinz | last post by:
Hello, I have a project that is used by other project in my solution. This common project is also used by a VB6 application (so it is placed in GAC). Since I did this (this is what I suspect...), every time I make a modification to this "common" project, I get the following error when I try to compile it:
0
6117
by: JC | last post by:
I am using Mysql version: 4.0.18-max-log and trying to populate a database from a text file using source option from inside the mysql environment. The population run OK but when creating the indexes i get < ----- ERROR -------------> Query OK, 1 row affected (0.00 sec)
2
1901
by: Rick | last post by:
Has anybody run across the following error when creating a new J# project? "Error writing the project file. Error loading type library/DLL." I think the same problem also causes the inability to change project settings when you open an existing project. Please let me know if you've seen this. Thanks, Rick
2
329
by: Paul P | last post by:
I am having a problem writing errors to the application log on a Windows 2003 server running IIS 6 The error message is "InvalidOperationException: Cannot open log for source {0}." I have created a Key called "TEST" under the Application in the Registry based on the microsoft article 329291 and using Solution 1 in that article In the code I basically do the following Dim MyLog as new EventLog( MyLog.Source = "TEST
0
1703
by: piyushc | last post by:
Hi, I am having problem creating new project using VS.Net 2003. Whenever I am trying to create new project (any type) it shows error message "Error writing the project file. Error loading type library/DLL". I faced this problem before and it was solved when I reinstall the
5
1662
by: djharrison | last post by:
Greetings, I am developing an application that writes values from an Access 2000 database to an SQL 7.0 server using DAO and linked tables. It seems to work fine for the first 26 of 108 tables, but part way through the population of the 27th table it stops and displays a 'Runtime Error 3001 Invalid Arguement' message. Not sure what to make of this. Any help would be appreciated.
3
7025
by: Jennifer | last post by:
On an ASP page I've got some code that is supposed to "export" data in a grid to an Excel file. What I'm doing is writing all the data to a text file, separating the fields by commas. Then I'll redirect the user to a new page with the file that was just created. Code: Dim objFSO, objTextFile Dim sRead, sReadLine, sReadAll Const ForReading = 1, ForWriting = 2, ForAppending = 8
0
1704
by: amit | last post by:
I am getting following error when I click ok. I have got this error while writting images in windows application.I am using visual studio 2005 I tried to get the exact error by putting my code in try catch block, and then the first error displayed is
9
11007
by: Jerry C | last post by:
I am trying to write to the errorlog and I am getting the error Cannot open log for source 'Application'. You may not have write access. This is the code: Dim Logevent As New EventLog("Application") Logevent.Source = "Application" Logevent.WriteEntry("Log In Error ", EventLogEntryType.Error)
1
2248
by: =?Utf-8?B?SGFycmlzb24gU2Nob2ZpbGw=?= | last post by:
I've got a developer who is running into problems getting a web app to write to a SQL database. I am posting his error message. Any ideas? Server Error in '/CTRS Web' Application. -------------------------------------------------------------------------------- Could not find a property named 'Account Number' on the type specified by the DataObjectTypeName property in ObjectDataSource 'ObjectDataSource1'.
0
9655
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
9498
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
10363
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...
1
10110
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9964
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
8993
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...
0
6749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4069
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.