473,772 Members | 2,388 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 1345
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
1661
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
7023
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
2247
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
9621
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
10106
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10039
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
8937
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
7461
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
6716
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();...
0
5355
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
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2851
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.