tags:

views:

189

answers:

0

We've received an XSD (and XSX) file from a customer that defines the format of the XML file that we will receive from them. I've used XSD.EXE to create a Data Table class that I use in my C# project to access the information within the XML file. This has worked and I have an import library that is able to read in an XML file and spit out the CSV files that are passed onto another application for processing (the application in question cannot take any other input form but CSV...)

Anyway we've received a new XSD document in the last week that has included relationships and now I'm unable to get XSD.EXE to generate the DataTable class without removing the relationships beforehand. I'm using the command line of:

xsd.exe /d /l:CS /edb InputData.xsd

and the output from XSD.exe is:

[Microsoft (R) .NET Framework, Version 2.0.50727.3038]
Copyright (C) Microsoft Corporation. All rights reserved.
Writing file 'C:\Projects\Input Output File Schemas\InputData.cs'.
Error: There was an error processing 'InputData.xsd'.
  - Error generating code for DataSet ''.
  - Unable to convert input xml file content to a DataSet. A relation already exists for these child columns.
  - A relation already exists for these child columns.

As I have said if I remove the relationships then XSD.EXE works fine and I get my InputData.cs file generated.

I'd really appreciate any pointers or assistance in how I can determine WHAT relationship(s) already exist and are causing the problem, I can't see a way of getting verbose or more detailed information from the utility. I've manually looked at the relationships and I can't see anything that is duplicated but shouldn't but XSD's are new to me and I'm not really confident that I know what I'm looking at so any help or pointers would be appreicated.