XSD Namespace to C# Namespace

前端 未结 2 530
不知归路
不知归路 2021-01-04 00:17

We are looking for a way to have C# autogenerate classes from an XSD and create C# namespaces using the namespace info in the XSD.

Doesnt seem like you can create a

相关标签:
2条回答
  • 2021-01-04 00:48

    There's a really interesting project XSD2Code on Codeplex. It basically does the same as xsd.exe - only better, on the command line, and as a Visual Studio plugin.

    You just right-click on an XSD file in your solution explorer and run the tool!

    alt text http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=Xsd2Code&DownloadId=41336

    You can set any valid .NET namespace as the target namespace for your generated code files.

    Update: the XSD2Code tool has been further developed and is now offered as both a free and a paid, commercial tool - see the official home page for more details.

    0 讨论(0)
  • 2021-01-04 00:56

    Would this do the trick? the /n allows you to specify a namespace to put the generated class in.

    xsd.exe /classes MyXSDInput.xsd /n:MyCsharpNamespace
    
    0 讨论(0)
提交回复
热议问题