John,
This question comes up quite frequently. You can search for responses
through
http://groups.google.com or
http://www.dotnet247.com. The short answer is, yes, your schema is probably W3C XML Schema compliant
and no, XSD.exe cannot infer a schema. As the error message says, the tool
doesn't process XML documents with recursive content, such as:
<root>
<child>
<child>bla</child>
</child>
</root>
You may want to try the schema inference tool at
http://apps.gotdotnet.com/xmltools/xsdinference/ or comment out the recursive
content and add it back to the generated schema by hand.
HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko [quoted text, click to view] "John" wrote:
> I have a xml file that I want to take it as xsd.exe's input to create schema
> file. When I do xsd sample.xml, I got error,
> Error: There was an error processing 'sample.xml'.
> - The same table (element) cannot be the child table in two nested
> relations.
>
> However, I read WSC xml specification, it meets the standard. Someone can
> help to tell me what is the problem?
>
> Thanks lot!
> John
>
> Following is the XMl file simple.xml is,
> <?xml version="1.0" ?>
> <xs:Data xmlns:xs="
http://www.test.com/Data/"> > <xs:all>
> <xs:element ref="cats"/>
> <xs:element ref="dogs"/>
> </xs:all>
> <xs:sequence>
> <xs:choice>
> <xs:element ref="left"/>
> <xs:element ref="right"/>
> </xs:choice>
> <xs:element ref="landmark"/>
> </xs:sequence>
> </xs:Data>
>