Click here to Skip to main content
15,922,419 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am running into a problem with an xml file that I run through xsd.exe at the command prompt. The error is - Cannot add constraint to DataTable 'Data' which is a child table in to nested relations.

My xml is produced from another software program as an L5X (just their fancy talk for xml) and other files I have ran through here without issue from the same source (albeit different projects)

What I have tried:

Had a scratch around on google, it appears other people had a similar problem but no answers thus far posted.

If I open visual studio I can open the xml file in question and select xml/create schema from the toolbar the output file is perfect and runs through the rest of my process without a hitch. I assume that visual studio is just running xsd.exe from runtime when I press that infer schema button so correct me im wrong but I assume I am missing some option switch when I run the xsd.exe

For reference the command I use at the prompt is

xsd.exe nameoffile.xml and that usually results in a nameoffile.xsd output in the same directory as the exe.

At the end of the day all I need is an executable that can pump out an xsd when given an xml so I can process the xsd further in my code. If you have any suggestions I would welcome them.

Any further info required just ask

Thanks
Posted
Updated 28-Sep-17 10:05am
Comments
RedDk 27-Sep-17 22:03pm    
There seems to be some copy about xsd.exe version disparity amoung VSs, all without much solace, but on the subject of which one your running, assuming we're talking windows here, in Task Manager you can see the process popup and there you can tab to service (if something were one) to pause ... but in Process you can right-click it and "Open File Location".

I'm curious too. When I run xsd from VS I do it on an open .xml file. Then I save the output as .xsd. You get errors? Where do they show up?

And finally, try doing xsd schema creation using the routine you get the errors from but use a WKWF (well known well formed) XML example.

1 solution

For what it's worth, running through the simple SQL/XML validation example steps found here:
ms-help://MS.SQLCC.v10/MS.SQLSVR.v10.en/s10de_2devguide/html/970e4553-b41d-4a12-ad50-0ee65d1f305d.htm
might serve to elucidate why problems are happening where you think they are ... when they aren't actually happening there at all. Another useful link might be here:
[sqlxml4sp1]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900