Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using xsd.exe to generate c# files from ereg association

Tags:

c#

xsd

I am trying to convert the XSD to some C# classes. I've done this with plenty of other files, but I am wondering why this one is not working.

The schema information contains a link in the download section to the XSD file which I've downloaded to my local disk. Then ran the XSD command from the ms dev tools.

This is the dump from the command prompt:

C:\temp\XSD>xsd version-13-draft-ivi-xsd-scheme.xsd /classes  /namespace:MyNamespace
Microsoft (R) Xml Schemas/DataTypes support utility
[Microsoft (R) .NET Framework, Version 4.6.1055.0]
Copyright (C) Microsoft Corporation. All rights reserved.
Schema validation warning: The 'http://www.w3.org/2000/09/xmldsig:Signature' element is not declared. Line 17, position 5.

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

Error: Error generating classes for schema 'version-13-draft-ivi-xsd-scheme'.
- The element 'http://www.w3.org/2000/09/xmldsig#:Signature' is missing.

If you would like more help, please type "xsd /?".

It seems like the XSD validator can not download the signature namespace. But I an not sure what exactly is happening. Can someone explain what is going wrong?

like image 337
dampee Avatar asked Oct 18 '25 06:10

dampee


1 Answers

Download http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd to your local directory, and add it as another parameter to your command:

xsd version-13-draft-ivi-xsd-scheme.xsd xmldsig-core-schema.xsd /Classes

The xsd you are wanting to import contains a reference to that file, on line 7:

<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd"/>
like image 153
lancew Avatar answered Oct 21 '25 10:10

lancew



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!