我在 XSD 文件中翻译了一个 XML。当我尝试在 SUP 中导入/使用 XSD 文件时,我收到“执行错误”:
"Cannot resolve namespace URI for qualified name: sap:label"
XML 和 XSD 都是自动创建的(由 SAP XML 和http://www.freeformatter.com/ XSD),所以我需要一些指导:D
这是 XML:
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="1.0"
xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx"
xmlns:gp="http://www.sap.com/Protocols/SAPData/GenericPlayer"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xmlns:sap="http://www.sap.com/Protocols/SAPData">
<edmx:DataServices m:DataServiceVersion="2.0">
<Schema Namespace="Z_SERVICE_BANK_V3"
xmlns="http://schemas.microsoft.com/ado/2008/09/edm">
<EntityType Name="Bank" sap:content-version="1">
<Key>
<PropertyRef Name="bankCountry"/>
<PropertyRef Name="bankID"/>
</Key>
<Property Name="bankCountry" Type="Edm.String" Nullable="false" MaxLength="3" sap:label="Bank Country" sap:filterable="false"/>
<Property Name="bankID" Type="Edm.String" Nullable="false" MaxLength="15" sap:label="Bank Key" sap:filterable="false"/>
<Property Name="bankName" Type="Edm.String" MaxLength="60" sap:label="Bank name" sap:filterable="false"/>
<Property Name="region" Type="Edm.String" MaxLength="3" sap:label="Region" sap:filterable="false"/>
<Property Name="street" Type="Edm.String" MaxLength="35" sap:label="Street" sap:filterable="false"/>
<Property Name="city" Type="Edm.String" MaxLength="35" sap:label="City" sap:filterable="false"/>
</EntityType>
<EntityContainer Name="Z_SERVICE_BANK_V3" m:IsDefaultEntityContainer="true">
<EntitySet Name="BankCollection" EntityType="Z_SERVICE_BANK_V3.Bank" sap:content-version="1"/>
</EntityContainer>
</Schema>
</edmx:DataServices>
</edmx:Edmx>
这是 XSD:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/ado/2008/09/edm">
<xs:element name="Schema">
<xs:complexType>
<xs:sequence>
<xs:element name="EntityType">
<xs:complexType>
<xs:sequence>
<xs:element name="Key">
<xs:complexType>
<xs:sequence>
<xs:element name="PropertyRef" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:string" name="Name" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Property" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:string" name="Name" use="optional"/>
<xs:attribute type="xs:string" name="Type" use="optional"/>
<xs:attribute type="xs:string" name="Nullable" use="optional"/>
<xs:attribute type="xs:byte" name="MaxLength" use="optional"/>
<xs:attribute xmlns:sap="http://www.sap.com/Protocols/SAPData" ref="sap:label"/>
<xs:attribute xmlns:sap="http://www.sap.com/Protocols/SAPData" ref="sap:filterable"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:string" name="Name"/>
<xs:attribute xmlns:sap="http://www.sap.com/Protocols/SAPData" ref="sap:content-version"/>
</xs:complexType>
</xs:element>
<xs:element name="EntityContainer">
<xs:complexType>
<xs:sequence>
<xs:element name="EntitySet">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:string" name="Name"/>
<xs:attribute type="xs:string" name="EntityType"/>
<xs:attribute xmlns:sap="http://www.sap.com/Protocols/SAPData" ref="sap:content-version"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:string" name="Name"/>
<xs:attribute xmlns:met="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" ref="met:IsDefaultEntityContainer"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:string" name="Namespace"/>
</xs:complexType>
</xs:element>
</xs:schema>
有任何想法吗 ?