Multi file XSD schema won't compile in C#.net 2.0 program

I am having difficulty referencing a multiple file XSD schema in a .Net 2005 
program. The schema files are shown below in their entirety.  

As soon as these files are included in my project, I get the following error 
compiling the program: 
	Unable to convert input xml file content to a DataSet. The 
‘http://www.mydomain.com/MySchemas/BuildingBlocks/Address/v1.0:PostalCodeID’ 
element is not declared.  

These schemas validate in XML Spy, and also in .NET 2005 with the XML Spy 
add-in loaded, so I don’t understand what the problem is.  If I change the 
“xsd:import namespace” declaration in the main schema to show the entire file 
name of the address schema (declaration would then look like this: 
<xsd:import 
namespace=http://www.mydomain.com/MySchemas/BuildingBlocks/Address/v1.0 
schemaLocation=”c:\source-web\MyWebService\MySchemas\AddressSchema.xsd” />) I 
see two entirely different errors: “The type ‘NewDataSet’ already contains a 
definition for ‘MyWebServiceRowChangeEventHandler’”, and “The type 
‘NewDataSet’ already contains a definition for ‘MyWebServiceRowChangeEvent’”. 
 These 2 errors occur in generated code that is placed in the .net temporary 
files on my computer.

All I am attempting to do is read the schema in to a validation handler and 
validate some XML.  It works fine if the schema is in a single file, but once 
the schema is broken into multiple files that are imported, the program won’t 
even compile.  When the schema files are included in the project, I get the 
errors regardless as to whether the code that uses the schemas is commented 
out or active.

Any help would be appreciated. Thanks.

Doug

Main Schema:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema 
xmlns:bcaw="http://www.mydomain.com/MySchemas/BuildingBlocks/bcaw/v1.0" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:Address="http://www.mydomain.com/MySchemas/BuildingBlocks/Address/v1.0" 
targetNamespace="http://www.mydomain.com/MySchemas/BuildingBlocks/bcaw/v1.0" 
elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xsd:import namespace="http://www.w3.org/2001/XMLSchema"/>
	<xsd:import 
namespace="http://www.mydomain.com/MySchemas/BuildingBlocks/Address/v1.0" 
schemaLocation="./AddressSchema.xsd"/>
	<xsd:element name="BeginDate" type="xsd:date"/>
	<xsd:element name="EndDate" type="xsd:date"/>
	<xsd:element name="OrgID" type="xsd:string"/>
	<xsd:element name="Level" type="xsd:string"/>
	<xsd:complexType name="MyInputType">
		<xsd:sequence>
			<xsd:element ref="bcaw:BeginDate" minOccurs="0"/>
			<xsd:element ref="bcaw:EndDate" minOccurs="0"/>
			<xsd:element ref="Address:PostalCodeID" minOccurs="0" maxOccurs="5"/>
			<xsd:element ref="bcaw:OrgID" minOccurs="0"/>
			<xsd:element ref="bcaw:Level" minOccurs="0"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:element name="MyInput" type="bcaw:MyInputType"/>
</xsd:schema>

AddressSchema.xsd:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:Address="http://www.mydomain.com/MySchemas/BuildingBlocks/Address/v1.0" 
targetNamespace=" 
http://www.mydomain.com/MySchemas/BuildingBlocks/Address/v1.0" 
elementFormDefault="unqualified" attributeFormDefault="unqualified">
	<xsd:element name="PostalCodeID" type="xsd:string">
		<xsd:annotation>
			<xsd:documentation>zip code of residence</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
</xsd:schema>

0
H (152)
10/23/2007 5:12:01 PM
dotnet.xml 7266 articles. 0 followers. Follow

1 Replies
661 Views

Similar Articles

[PageSpeed] 8

I figured this out - I created a web site to publish the schemas, and did not 
include them as files in the .NET project.  The web.config file has a custom 
configuration section that shows the URL location of the schemas, which is 
referenced in the code when the schemas are loaded in.  The URL is then used 
instead of the file name to load the schema ("schema.add(null, urlofschema)" 
etc.).  It works when I do it that way, so I guess the solution is to NOT 
have the schemas as part of the project.  

Doug H


"Doug H" wrote:

> I am having difficulty referencing a multiple file XSD schema in a .Net 2005 
> program. The schema files are shown below in their entirety.  
> 
> As soon as these files are included in my project, I get the following error 
> compiling the program: 
> 	Unable to convert input xml file content to a DataSet. The 
> ‘http://www.mydomain.com/MySchemas/BuildingBlocks/Address/v1.0:PostalCodeID’ 
> element is not declared.  
> 
> These schemas validate in XML Spy, and also in .NET 2005 with the XML Spy 
> add-in loaded, so I don’t understand what the problem is.  If I change the 
> “xsd:import namespace” declaration in the main schema to show the entire file 
> name of the address schema (declaration would then look like this: 
> <xsd:import 
> namespace=http://www.mydomain.com/MySchemas/BuildingBlocks/Address/v1.0 
> schemaLocation=”c:\source-web\MyWebService\MySchemas\AddressSchema.xsd” />) I 
> see two entirely different errors: “The type ‘NewDataSet’ already contains a 
> definition for ‘MyWebServiceRowChangeEventHandler’”, and “The type 
> ‘NewDataSet’ already contains a definition for ‘MyWebServiceRowChangeEvent’”. 
>  These 2 errors occur in generated code that is placed in the .net temporary 
> files on my computer.
> 
> All I am attempting to do is read the schema in to a validation handler and 
> validate some XML.  It works fine if the schema is in a single file, but once 
> the schema is broken into multiple files that are imported, the program won’t 
> even compile.  When the schema files are included in the project, I get the 
> errors regardless as to whether the code that uses the schemas is commented 
> out or active.
> 
> Any help would be appreciated. Thanks.
> 
> Doug
> 
> Main Schema:
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema 
> xmlns:bcaw="http://www.mydomain.com/MySchemas/BuildingBlocks/bcaw/v1.0" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> xmlns:Address="http://www.mydomain.com/MySchemas/BuildingBlocks/Address/v1.0" 
> targetNamespace="http://www.mydomain.com/MySchemas/BuildingBlocks/bcaw/v1.0" 
> elementFormDefault="qualified" attributeFormDefault="unqualified">
> 	<xsd:import namespace="http://www.w3.org/2001/XMLSchema"/>
> 	<xsd:import 
> namespace="http://www.mydomain.com/MySchemas/BuildingBlocks/Address/v1.0" 
> schemaLocation="./AddressSchema.xsd"/>
> 	<xsd:element name="BeginDate" type="xsd:date"/>
> 	<xsd:element name="EndDate" type="xsd:date"/>
> 	<xsd:element name="OrgID" type="xsd:string"/>
> 	<xsd:element name="Level" type="xsd:string"/>
> 	<xsd:complexType name="MyInputType">
> 		<xsd:sequence>
> 			<xsd:element ref="bcaw:BeginDate" minOccurs="0"/>
> 			<xsd:element ref="bcaw:EndDate" minOccurs="0"/>
> 			<xsd:element ref="Address:PostalCodeID" minOccurs="0" maxOccurs="5"/>
> 			<xsd:element ref="bcaw:OrgID" minOccurs="0"/>
> 			<xsd:element ref="bcaw:Level" minOccurs="0"/>
> 		</xsd:sequence>
> 	</xsd:complexType>
> 	<xsd:element name="MyInput" type="bcaw:MyInputType"/>
> </xsd:schema>
> 
> AddressSchema.xsd:
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> xmlns:Address="http://www.mydomain.com/MySchemas/BuildingBlocks/Address/v1.0" 
> targetNamespace=" 
> http://www.mydomain.com/MySchemas/BuildingBlocks/Address/v1.0" 
> elementFormDefault="unqualified" attributeFormDefault="unqualified">
> 	<xsd:element name="PostalCodeID" type="xsd:string">
> 		<xsd:annotation>
> 			<xsd:documentation>zip code of residence</xsd:documentation>
> 		</xsd:annotation>
> 	</xsd:element>
> </xsd:schema>
> 
0
DougH1 (5)
10/24/2007 3:16:03 PM
Reply:

Similar Artilces:

Any one have crm 3.0 installation and config certification dumps
Hi Folks , If Any one have crm 3.0 installation and config certification dumps , Please post it or send to krishna.919@gmail.com Thanks Kris I would hope that most people on this group would take the time to study for these exams and pass them honestly otherwise whats the point? ======================= John O'Donnell Microsoft CRM MVP http://codegallery.gotdotnet.com/crm <krishna.919@gmail.com> wrote in message news:1150431230.275661.283440@g10g2000cwb.googlegroups.com... > Hi Folks , > If Any one have crm 3.0 installation and config certification dumps , > Please...

Screen Updating #2
Hi, On my worksheet I have put some code in to stop the screen flickerin like mad when it's updating the figures. The code is *application.screenupating = false*. This works fine. However, when I publish this document to our loca intranet, the figures do not update. I have found that it is due t the above line in the macro. Can anyone suggest a simple workaround for this, please? Many thanks, Dan -- Voodooda ----------------------------------------------------------------------- Voodoodan's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=59 View this th...

Error opening a ppt file
This is the message I get. Well I cannot do a screen capture here but it basically says PPT does not have a converter for it. I have had no problem with others. wtdrm, Difficult to say what's wrong without the exact message, but maybe this will help: http://www.pptfaq.com/FAQ00135.htm -- Luc Sanders MVP - PowerPoint "wtdrm" <wtdrm@discussions.microsoft.com> schreef in bericht news:38C8DF58-B95A-48F8-8D95-76407412D383@microsoft.com... > This is the message I get. > > > Well I cannot do a screen capture here but it basicall...

MAC OS Excel 2008 Visual Basic Programming
Hi All I have designed a application in MS Excel 2008 on Windows XP using Visual Basic Application (VBA). Each and every thing is going fine on my side. My client is using MAC OS and MS Office for MAC. When i deployed my application to Client end one serious problem comes arise. The problem is that when my client is opening this project he is getting it into the Design Mode. He is unable to select from drop downs, enter values to text boxes........ Please help me guys. I put my all the efforts. I think now its the time to put your efforts. ...

Archiving problems #2
I am trying to set my auto archive settings so that SENT and DELETED messages older than 6 mo. are archived in one Archive folder, then are archived from that folder into a 2nd Archive folder after 12 mo. I have set this option for SENT/DELETED folders w/ right-click, Properties, AutoArchve, "Archive folder using these settings." However, I don't know how to get the folders to Archive immediately; also, I see msgs in these folders that are not following the rules I set (their sent/received dates do not match the 6/12 mo. settings). Another Archiving problem is that I ...

read only .pst files
Is there any way to read a pst file without changing it? I archived all my documents and then put the file on a CD in order to free up some disk space (and take my documents home). Now I cannot access it without reloading it. I don't want to change anything, I just want to be able to read the documents. Thanks, In article <eC1yNvcRDHA.1688@TK2MSFTNGP11.phx.gbl>, srv01@hotmail.com says... > Is there any way to read a pst file without changing it? I archived all my > documents and then put the file on a CD in order to free up some disk space > (and take my documents ho...

Deleted investments #2
Every time I try to use an investment name that I deleted a while ago, I'm told I can't use it again. Is there some way to "empty" the "deleted investments" folder? Thanks! In microsoft.public.money, davenc wrote: >Every time I try to use an investment name that I deleted a while ago, I'm >told I can't use it again. Is there some way to "empty" the "deleted >investments" folder? Thanks! Undelete it by entering a fake dividend for the investment. Then blank out its symbol, and change the name to something you will not wa...

READ FROM RESOURCE FILE (.RC)
Hi, I want to read version number and company name from RC File at run time. How can i do this ? Thanks in advance Hello, You should use GetFileVersionInfoSize , GetFileVersionInfo , VerQueryValue API's for this. Sreeram "Cheickna Traor�" <cheickna.traore@almas.fr> wrote in message news:bfloaf$pml$1@s1.read.news.oleane.net... > Hi, > > I want to read version number and company name from RC File at run time. > How can i do this ? > > Thanks in advance > > Hi, Please check this Article ID: Q167597 in MSDN. Sample source code is available. ...

backing up to a CD-RW #2
When i attempt to backup to a CD-RW, I am instructed that I do not have administartor's privlidges to do so. I have Windows XP, and I am the administrator and only active account. I have double-checked and I am listed as the computer's administrator. Is this a "Money" administrator, or computer administrator? m> When i attempt to backup to a CD-RW, I am instructed that I do m> not have administartor's privlidges to do so. I have Windows m> XP, and I am the administrator and only active account. I m> have double-checked and I am listed as the compute...

multi-column data consolidation
Hi guys, here is my problem.... Scenario: - Column A to F are months (Jan to June) - Beneath each month (starting row 2 downwards), text data will b entered. Question: How can I have the six months add up or compiled as a single colum database in another sheet or a separate column in that same sheet? will be adding data every so often under these months and it shoul update the database. Thank you for any assistance/help -- Message posted from http://www.ExcelForum.com Question is not clear to me. Not sure what 'add up or compile' means with text entries Perhaps, in G2 enter =...

MS CRM 1.2 or 3.0 for Help Desk Ticketing solution
Does anyone use this for a Ticketing program? I know we have the customer service module but have never used it. Is there any documentation on how to set it up as a help desk solution. Thanks Todd Yes , U can surely do this by making a case and the case number can be considered a s Ticket number. You will have to dive deep into the whole process to map it to CRM Rgds SAM "Todd" wrote: > Does anyone use this for a Ticketing program? I know we have the customer > service module but have never used it. Is there any documentation on how to > set it up as a help desk ...

Outlook Data Files being automatically created
Hello, I have a user who has about 7 PST's and only created 1. We have been able to delete the other 6 in the past, but they eventually come back without any user creation. This is Outlook 2002, and on an Exchange 5.5 server. Any ideas on how to stop this? He is the only one with this issue in an environment with over 100 users. Thanks, Jeff Jeff <anonymous@discussions.microsoft.com> wrote: > I have a user who has about 7 PST's and only created 1. We > have been able to delete the other 6 in the past, but they > eventually come back without any user creation. ...

saving/moving outlook files
I need to re-format my hard drive and re-install my OS after being infected with a trojan. How do I download my Outlook files to a disk and then move them back to my hard drive? ...

Logging all in and outgoing mail #2
Hi all, Is it possible to log all incomming and outgoing mail? If so, c ...

Cell Format #2
I need to format a column of cells to contain a duration of time (ie. the length of a song such as 4:39) so I can total the column and get an Hours, Minutes and Seconds result but the only format I can find will display this a 4:39 AM. Can anyone help? Thanks Hi 4:39 AM is 4 hours 39 minutes. Which is 60 times what you want (unless your songs are hours long that is :-). Select the cells, go menu Format > Cells, select Custom and enter [m]:ss in the text field. Note that you still have to enter time like h:m:s ; 0:4:39 , or you'll end up with 4 hours 39 minutes. HTH. Best wishes Ha...

help file on gdiplus
Hi, I want to find the help file of gdiplus, gdiplus.chm. Do you know where can I find it ? Thinks in advance David PS : you can send it to me to my email adress if you have it If you have downloaded the SDK it should be in the regular help file or the SDK's help file. I don't think there's such thing as a seperate help for just GDI+. david wrote: > Hi, > > I want to find the help file of gdiplus, gdiplus.chm. > Do you know where can I find it ? > > Thinks in advance > > David > > PS : you can send it to me to my email adress if you have i...

import/export file by using vbscript
hi all, i need vbscript code for to import .sc2 file to outlook in order to export calender information from lotus notes to outlook thanks anyway Ersin ...

Execute .bat File Within VBA
I have a batch file that is created via VBA. I have tried using the Shell command to get it to execute but it will only execute in this way if I put the shell command in the immediate window. the batch file will also execute if I double click on it. Do you have any suggestions as to what I might be doing wrong? I have tried: Shell ("c:\batchfile.bat") and: strShell = "CMD.EXE /c c:\batchfile.bat" Call Shell(strShell, vbMaximizedFocus) Neither have worked. On Mar 23, 9:08=A0am, Jonas <sun...@yahoo.com> wrote: > I have a batch file that is crea...

Trying to view macros in a .XLS file?
I've got a .XLS file that the client says contains various financial calculation macros used by their spreadsheets. I have to duplicate those functions in an MS Access environment. Two problems: 1) I don't have a clue.... 2) When I open up the .XLS and poke around, I cannot find anything like what the user says is there. I know the names of some of the macros because I've been through the calcs in one of the using spreadsheets - and changed the references from some non-existant UNC to the local copy of the .XLS file.....and then they work....So, I conclude that the macros are...

Outlook 2002
It is very confusing... Every night around 6pm when I try to send an email the 550 not local host xxxxx, not a gateway message appears. Obviously, the message is immediately undeliverable. Does someone have some help or suggestions? Running Windows 2000. Have you called your ISP? Joel wrote: > It is very confusing... Every night around 6pm when I try > to send an email the 550 not local host xxxxx, not a > gateway message appears. Obviously, the message is > immediately undeliverable. > > Does someone have some help or suggestions? Running > Windows 2000. You ...

Security for Xml File
Hello world, How to protect Xml Files in a We Site Directory ? Is it possible to protect Xml file like Sql Security ? Nico * Nicolas Joly wrote in microsoft.public.dotnet.xml: >How to protect Xml Files in a We Site Directory ? >Is it possible to protect Xml file like Sql Security ? Hi Nicolas, I am not sure which kind of "protection" you are looking for, if you just worry about access from unauthorized users to an XML document on a web server, you could simply use HTTP facilities to deny access or request for authorization. If you worry about the integrity of the document...

Multi profile
I have configured outlook 2007 to use multi profiles. When I close the outloop and re-open to select other profile the profiles select list is not prompted. I have set for prompt for profile. But I observed this, after closing outlook still the task manager shows Outlook.exe is runing..when I kill that and re-open I can see the profiles and select particular. Now my question, why Outlook is runnning though its closed. My setting "Hide when minimized" is already OFF. thanks Hi abcd, have a look in the "Task Manager" under "Process" if Outlook.exe is stil...

XmlSchema.Read not creating the SOM #2
I'm using the following code to create an XmlSchema from an XSD file The Read() method doesn't throw any errors and after I write the schem to a file, it looks as expected. However, after the Read() method is called, m_Schema still contains n items. What am I doing wrong? My .xsd file validates fine in XMLSpy, but it i quite complex, so maybe .Net can't handle it? // Code follows System.Xml.XmlTextReader m_XMLReader = ne System.Xml.XmlTextReader(m_SchemaLocation); System.Xml.Schema.XmlSchema m_Schema System.Xml.Schema.XmlSchema.Read(m_XMLReader, null); System.Xml.XmlTextWrit...

User name and password #2
I cannot send mail. It keeps posting the user name and password box of which all data entered is correct. I re-enter it and hit send and the box pops up again. It was working ok and nothing has been changed since. Are you on an exchange server or part of a domain? Are you using Exchange server or are you part of a domain? ...

Mac Stuff CDs, A to Z, updated 15/Jan/2006, and Win & Mac programs, 'WinMac', 'PC/MaC', 'Win-Mac', 'Multi', 'Multi-Platform', 'MultiFormat', 'MULTIOS', 'HYBRID'
Mac Stuff CDs, A to Z, updated 15/Jan/2006, and Win & Mac programs, 'WinMac', 'PC/MaC', 'Win-Mac', 'Multi', 'Multi-Platform', 'MultiFormat', 'MULTIOS', 'HYBRID' GARAGE SALES, buy, risk-free purchase, working, tested, fully functional, very cheap discounted price, low cost, quality OEM software, -------------------------------------------------------- Abvent Artlantis v4.5 Mac 1CD Abvent.PhotoCAD.v1.0.MacOSX ACD.Systems.Canvas.X.0.2.925.MacOSX Adobe.Acrobat.7.0.Pro.for.Mac.OS 1CD Adobe Acrobat 6.0.0 Professional Mac OSX 1CD ...