我有一個xml檔案,其中有dt:dt,我以前從未見過:
<enfinity xsi:schemaLocation="http://www.intershop.com/xml/ns/enfinity/7.0/xcs/impex catalog.xsd http://www.intershop.com/xml/ns/enfinity/6.5/core/impex-dt dt. xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www. intershop.com/xml/ns/enfinity/7.0/xcs/impex" xmlns:xml="http://www. w3.org/XML/1998/namespace" xmlns:dt="http://www.intershop.com/xml/ns/enfinity/6. 5/core/impex-dt" major="6" minor="1" family="enfinity" branch="enterprise""build">
<offer sku="423182110"/span>>
<custom-attributes>/span>
<custom-attribute name="sizeEU" dt。 dt="string">/span>42</custom-attribute>/span>
</custom-attributes>/span>
</offer>/span>
</enfinity>
當我用VS在上述xml的基礎上創建一個xsd時,它創建了2個檔案:
<xs:schema xmlns:tns="http://www.intershop.com/xml/ns/enfinity/6. 5/core/impex-dt" attributeFormDefault="不合格" elementFormDefault="qualified" targetNamespace="http: //www. intershop.com/xml/ns/enfinity/6.5/core/impex-dt" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs: attribute name="dt" type="xs:string" />
</xs:schema>
而且
<?xml version="1.0" encoding="utf-8"? >
<xs:schema xmlns:xsi="http://www. w3.org/2001/XMLSchema-instance" xmlns:dt="http://www.intershop.com/xml/ns/enfinity/6. 5/core/impex-dt" attributeFormDefault="不合格" elementFormDefault="qualified" targetNamespace="http: //www. intershop.com/xml/ns/enfinity/7.0/xcs/impex" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://www.w3.org/XML/1998/namespace" />
<xs:import namespace="http://www.intershop.com/xml/ns/enfinity/6.5/core/impex-dt"/span> />
<xs: element name="enfinity">
<xs:complexType>>
<xs:sequence>/span>
<xs: element maxOccurs="unbounded" name="offer"> name=>
<xs:complexType>/span>
<xs:sequence>/span>
<xs:element name="short-description"/span>>
<xs:complexType>>
<xs:simpleContent>/span>
<xs:extension base="xs:string">/span>
<xs:attributee ref="xml。 lang" use="required" <>
</xs:extension>
</xs:simpleContent>
</xs:complexType>/span>
</xs:element>/span>
<xs: element minOccurs="0" name="varials"> name="varials">
<xs:complexType>/span>
<xs:sequence>/span>
<xs:element name="mastered-products">
<xs:complexType>>
<xs:sequence>/span>
<xs: element maxOccurs="unbounded" name="mastered-product">
<xs:complexType>/span>
<xs: attribute name="sku" type="xs: unsignedInt" use="required" />
<xs: attribute name="domain" type="xs: string" use="required" <>
<xs: attribute name="default" type="xs: unsignedByte" use="required" <>
<xs: attribute name="productvariationposition" type="xs: unsignedShort" use="required" />
</xs:complexType>
</xs:element>/span>
</xs:sequence>/span>
</xs:complexType>>
</xs:element>/span>
<xs:element name="variation-attributes">/span>
<xs:complexType>>
<xs:sequence>/span>
<xs: element maxOccurs="unbounded" name="variation-attribute">
<xs:complexType>/span>
<xs:sequence>/span>
<xs: element name="presentation-option" type="xs:string" />
<xs: element minOccurs="0" name="presentation-product-attribute-name" type="xs: string"/span> />
<xs: element name="custom-attributes">
<xs:complexType>/span>
<xs:sequence>/span>
<xs:element name="custom-attribute"/span>>
<xs:complexType>/span>
<xs:simpleContent>/span>
<xs:extension base="xs:string">/span>
<xs:attributee name="name" type="xs。 string" use="required" <>
<xs: attribute ref="dt: dt" use="required" />
<xs:attributee ref="xml。 lang" use="required" <>
</xs:extension>
</xs:simpleContent>
</xs:complexType>/span>
</xs:element>/span>
</xs:sequence>/span>
</xs:complexType>>
</xs: element>
</xs:sequence>/span>
<xs: attribute name="name" type="xs: string" use="required" <>
</xs:complexType>
</xs:element>/span>
</xs:sequence>/span>
</xs:complexType>>
</xs: element>
</xs:sequence>/span>
</xs:complexType>>
</xs: element>
<xs:element name="custom-attributes">/span>
<xs:complexType>/span>
<xs:sequence>/span>
<xs: element maxOccurs="unbounded" name="custom-attribute">
<xs:complexType>/span>
<xs:simpleContent>/span>
<xs:extension base="xs:string"/span>>
<xs:attributee name="name" type="xs。 string" use="required" <>
<xs: attribute ref="dt: dt" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>/span>
</xs:element>/span>
</xs:sequence>/span>
</xs:complexType>>
</xs: element>
</xs:sequence>/span>
<xs: attribute name="sku" type="xs: unsignedInt" use="required" />
</xs:complexType>
</xs:element>/span>
</xs:sequence>/span>
<xs:attribute name=" major" type="xs: unsignedByte" use="required" />
<xs: attribute name="minor" type="xs: unsignedByte" use="required" />
<xs:attributee name=" family" type="xs: string" use="required" <>
<xs:attributee name=" branch" type="xs: string" use="required" <>
<xs:attributee name="building" type="xs: string" use="required" <>
</xs:complexType>
</xs:element>/span>
</xs:schema>/span>
我相信我需要編輯較大的xsd,以便它知道其他xsd模式的位置,但我如何做到這一點? 目前,當我在VS中打開較大的xsd時,它只有這個錯誤
我試著改變
<xs:import namespace="intershop. com/xml/ns/enfinity/6.5/core/impex-dt"/span> />
to
<xs:import namespace="intershop.com/xml/ns/enfinity/6。 5/core/impex-dt" dt:schemaLocation="C:UsersTommyTamDownloadsUpload To ExponeaMulesoftItem Variant Flow PollItem Variant Flow Poll_XML(ADDITIONAL).xsd dt.xsd"/>
但是它仍然不正確。
uj5u.com熱心網友回復:
xs:import元素將schemaLocation屬性(https://www.w3.org/TR/xmlschema-0/#schemaLocation)作為一個相對或絕對的URL,指向一個包含該命名空間的模式的檔案,所以e. g. <xs:import namespace="http://www.intershop.com/xml/ns/enfinity/6.5/core/impex-dt" schemaLocation="dt.xsd"/>將是一種指向本地檔案的方式,該檔案名為dt.xsd,與包含xs:import宣告的檔案在同一目錄中。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/324060.html
標籤:
