1

私はスキーマ構築の初心者であり、名前空間参照がどのように機能するかを理解するのに問題があります。私は、BizTalk に似たアプリケーションを使用しており、次のスキーマでエンベロープ解除操作を実行しています。これが一般的なエラーかどうかはわかりませんが、次のエラーが表示されます。

エラー

XmlSchemaValidationException, Type 'http://Wheelhouse/Property:PropertyType' is not declared. : 

プロパティ定義

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://Wheelhouse/Property" elementFormDefault="qualified" targetNamespace="http://Wheelhouse/Property" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="Property" type="PropertyType" />
  <xs:complexType name="PropertyType">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" name="ID" />
      <xs:element minOccurs="0" maxOccurs="1" name="Listing_Number" />
      <xs:element minOccurs="0" maxOccurs="1" name="Status" />
    </xs:sequence>
  </xs:complexType>
</xs:schema>

プロパティ リストの定義

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:import schemaLocation="blueintegrator://Wheelhouse/PropertyDefinition__4f3f265569d54e9fa898eba835502c6a_" namespace="http://Wheelhouse/Property" />
  <xs:element xmlns="http://Wheelhouse/Property" name="Root">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" name="Property" type="PropertyType" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
4

1 に答える 1

0

機能しない理由は、schemaLocation 属性の URI スキーム (blueintegrator) に関係しています。ほとんどの場合、XSD を使用するために使用しているツールはその URI を理解していないため、http://Wheelhouse/Property:PropertyType型の定義を含む XSD をロードできません。

「通常の」ツールの場合、その属性の値を別のものに変更すると (たとえば、両方のファイルを同じフォルダーに入れ、schemaLocation の値全体をファイルの名前に置き換える場合)、スキーマがは完全に有効です。

于 2013-03-28T20:09:31.770 に答える