Reputation: 31
I have an XML translated in a XSD file. When I'm trying to import/use the XSD file in SUP, I receive an "Execution error":
"Cannot resolve namespace URI for qualified name: sap:label"
Both, the XML and XSD where created automaticaly (by SAP the XML and http://www.freeformatter.com/ the XSD) so I kinda need some guidance :D
Here is the 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>
And here is the 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>
Any ideas ?
Upvotes: 1
Views: 2827
Reputation: 25054
The XML sample you give has elements and attributes in several namespaces:
XSD schema documents declare components (elements, attributes, types) for a single target namespace; you will need at least four schema documents to declare all the elements and attributes in your XML document.
The XSD you have generated covers part, not all, of the document (it starts at the {http://schemas.microsoft.com/ado/2008/09/edm}Schema element, not at the {http://schemas.microsoft.com/ado/2007/06/edmx}Edmx element), and it has no xsl:import for the other namespaces. Short answer: either you didn't call the schema generator appropriately, or it's not up to the task you're setting it. You are likely to need either (1) a more capable black-box solution or (2) better understanding of XSD and its use, or both.
But in the short term -- all of the namespaces involved are defined by large competent technical organizations. Why are you writing your own schemas for those namespaces? Have you looked for XSD schema documents defining these formats from the owners of the namespaces?
Upvotes: 2