views:

1417

answers:

1

I would like to produce C# helper files from the KML2.2 xml schema using the XSD.exe tool (from VS2008 SDK). With KML2.1, the tool worked just fine. However, the KML2.2 schema contains import tags pointing to other schemas causing XSD.exe to freak out.

This is the error message I get:

C:\Program Files\Microsoft Visual Studio 2008 SDK\VisualStudioIntegration\Sample s\Sdm> xsd.exe d:\temp\kml22.xsd /c /l:CS /n:Google.Kml22 /o:D:\temp\

Microsoft (R) Xml Schemas/DataTypes support utility [Microsoft (R) .NET Framework, Version 2.0.50727.3038] Copyright (C) Microsoft Corporation. All rights reserved.

Schema validation warning: The 'http://www.w3.org/2005/Atom:author' element is not declared. Line 311, position 12.

Schema validation warning: The 'http://www.w3.org/2005/Atom:link' element is not declared. Line 312, position 12. Schema validation warning: The 'urn:oasis:names:tc:ciq:xsdschema:xAL:2.0:Address Details' element is not declared. Line 314, position 12.

Warning: Schema could not be validated. Class generation may fail or may produce incorrect results.

Error: Error generating classes for schema 'd:\temp\kml22'. - The element 'http://www.w3.org/2005/Atom:author' is missing.

Do you have suggestions how could I generate my C# helper files?

+3  A: 

You have to specify all of the XSDs involved, including imports, in the command line. Here's a blog post with an example.

R Ubben