xsd.exe支持含有xsd:import的schema文件的类生成

又要根据xsd文件生成类了,这次遇到的xsd文件(TrackWebServiceSchema.xsd)有一个特点,就是它内部又导入了别的命名空间,其导入语句如下:

<xsd:import namespace="http://www.ups.com/XMLSchema/XOLTWS/Common/v1.0" schemaLocation="common.xsd"/>

正如其语法所表达的,导入的命名空间在另外一个叫做common.xsd的文件中。因此在根据A.xsd生成类文件的时候,需要同时指定common.xsd,方法是使用如下的命令行:

xsd /c /l:vb /n:UPS.Tracking TrackWebServiceSchema.xsd common.xsd

原文地址:https://www.cnblogs.com/Ricky81317/p/1733208.html