473,408 Members | 2,405 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.

(XmlSchema->targetNamespace) error while writing xsd

Hello,

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

(1) I get an error while writitng if the XSD has a taregetnamespace.
(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.com/HD"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:hd="http://www.homedepot.com/HD">

Following is the code

XmlSchema* schema = new XmlSchema();
XmlNamespaceManager* nsmgr = new XmlNamespaceManager(new NameTable());
nsmgr->AddNamespace("xs", "http://www.w3.org/2001/XMLSchema");
nsmgr->AddNamespace("hd", "http://www.homedepot.com/HD");
schema->TaregetNamspace = "http://www.homedepot.com/HD";
System::IO::FileStream* fs = new FileStream("XSDWrite.xsd",
FileMode::OpenOrCreate);
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 1323
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**********@abosoftware.com> wrote in message
news:O2**************@tk2msftngp13.phx.gbl...
Hello,

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

(1) I get an error while writitng if the XSD has a taregetnamespace.
(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.com/HD"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:hd="http://www.homedepot.com/HD">

Following is the code

XmlSchema* schema = new XmlSchema();
XmlNamespaceManager* nsmgr = new XmlNamespaceManager(new NameTable());
nsmgr->AddNamespace("xs", "http://www.w3.org/2001/XMLSchema");
nsmgr->AddNamespace("hd", "http://www.homedepot.com/HD");
schema->TaregetNamspace = "http://www.homedepot.com/HD";
System::IO::FileStream* fs = new FileStream("XSDWrite.xsd",
FileMode::OpenOrCreate);
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
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...
0
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...
2
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...
2
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...
0
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...
5
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,...
3
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...
0
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...
9
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...
1
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....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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.