使用标准UBL2.0,使用xsd.exe从多个xsd方案生成c#文件
使用xsd.exe生成标准UBL2.0的c#文件,获得错误和警告 我有档案 这是我正在运行的命令:使用标准UBL2.0,使用xsd.exe从多个xsd方案生成c#文件,c#,xsd,C#,Xsd,使用xsd.exe生成标准UBL2.0的c#文件,获得错误和警告 我有档案 这是我正在运行的命令: E:\Invoice\maindoc>xsd.exe /c UBL-Invoice-2.0.xsd UBL-CommonAggregat eComponents-2.0.xsd UBL-CommonBasicComponents-2.0.xsd UnqualifiedDataTypeSchemaModule-2.0.xsd UBL-CommonExtensionComponent
E:\Invoice\maindoc>xsd.exe /c UBL-Invoice-2.0.xsd UBL-CommonAggregat eComponents-2.0.xsd UBL-CommonBasicComponents-2.0.xsd UnqualifiedDataTypeSchemaModule-2.0.xsd UBL-CommonExtensionComponents-2.0.xsd UBL-QualifiedDatatypes-2.0.xsd
以下是我遇到的错误:
Microsoft (R) Xml Schemas/DataTypes support utility
[Microsoft (R) .NET Framework, Version 4.0.30319.17929]
Copyright (C) Microsoft Corporation. All rights reserved.
Schema validation warning: Type urn:un:unece:uncefact:codelist:specification:54 217:2001:CurrencyCodeContentType' is not declared, or is not a simple type. Line 72, position 14.
Schema validation warning: Type 'urn:un:unece:uncefact:codelist:specification:66 411:2001:UnitCodeContentType' is not declared, or is not a simple type. Line 1050, position 14.
Schema validation warning: Type 'urn:un:unece:uncefact:codelist:specification:66 411:2001:UnitCodeContentType' is not declared, or is not a simple type. Line 946, position 14.
Schema validation warning: Type urn:un:unece:uncefact:codelist:specification:IANAMIMEMediaType:2003:BinaryObjec MimeCodeContentType' is not declared, or is not a simple type. Line 122, position 14.
Schema validation warning: Type 'urn:un:unece:uncefact:codelist:specification:IANAMIMEMediaType:2003:BinaryObjectMimeCodeContentType' is not declared, or is not a simple type. Line 232, position 14.
Schema validation warning: Type 'urn:un:unece:uncefact:codelist:specification:IANAMIMEMediaType:2003:BinaryObjectMimeCodeContentType' is not declared, or is not a simple type. Line 327, position 14.
Schema validation warning: Type 'urn:un:unece:uncefact:codelist:specification:IANAMIMEMediaType:2003:BinaryObjectMimeCodeContentType' is not declared, or is not a simple type. Line 422, position 14.
Schema validation warning: Type 'urn:un:unece:uncefact:codelist:specification:IANAMIMEMediaType:2003:BinaryObjectMimeCodeContentType' is not declared, or is not a simple type. Line 517, position 14.
Warning: Schema could not be validated. Class generation may fail or may produce incorrect results.
Error: Error generating classes for schema 'UBL-Invoice-2_0_UBL-CommonAggregateComponents-2_0_UBL-CommonBasicComponents-2_0_UnqualifiedDataTypeSchemaModule-2_0_UBL-CommonExtensionComponents-2_0_UBL-QualifiedDatatypes-2_0'. - The datatype 'urn:un:unece:uncefact:codelist:specification:66411:2001:UnitCodeContentType' is missing.
If you would like more help, please type "xsd /?".
我的代码导入到文件UBL-Invoice-2.0.xsd中:
<!-- ===== xsd:schema Element With Namespaces Declarations ===== -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:
CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:
CommonBasicComponents-2"
xmlns:udt="urn:un:unece:uncefact:data:specification:
UnqualifiedDataTypesSchemaModule:2"
xmlns:ccts="urn:un:unece:uncefact:documentation:2"
xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:
CommonExtensionComponents-2"
xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.0">
<!-- ===== Imports ===== -->
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" schemaLocation="UBL-CommonAggregateComponents-2.0.xsd"/>
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" schemaLocation="UBL-CommonBasicComponents-2.0.xsd"/>
<xsd:import namespace="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" schemaLocation="UnqualifiedDataTypeSchemaModule-2.0.xsd"/>
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" schemaLocation="UBL-CommonExtensionComponents-2.0.xsd"/>
<xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" schemaLocation="UBL-QualifiedDatatypes-2.0.xsd"/>
<!-- ===== Root Element ===== -->
最有可能的是,涉及到另一个模式,并且包括了 要在构建中进行说明 如果XSD是有效的,那么您应该能够提取所有涉及的模式 使用VS project将现有项添加到项目中,这将解决或 公开XML模式的所有问题
您可以查看的一个区域是
,很可能涉及到另一个模式,并且包含了另一个模式
要在构建中进行说明
如果XSD是有效的,那么您应该能够提取所有涉及的模式
使用VS project将现有项添加到项目中,这将解决或
公开XML模式的所有问题
您可以查看的一个区域是