2016-10-29 10 views
1

は、XMLスキーマの問題を持ちます。それは検証エラーの原因となり、私は問題が何か不思議です。要素タイプ「XS:要素は」「>」、どちらかの属性指定が続かなければなりませんか「/>」

<?xml version="1.0" encoding="UTF-8"?> 
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> 
     <xs:element name="row"> 
     <xs:complexType> 
      <xs:sequence> 
      <xs:element type="xs:string" name="abstract"/> 
      <xs:element type="xs:string" name="bibliography"/> 
      <xs:element type="xs:string" name="catno"/> 
      <xs:element type="xs:string" name="citation"/> 
      <xs:element type="xs:string" name="copyrightnotice"/> 
      <xs:element type="xs:string" name="description"/ minOccurs="0" maxOccurs="unbounded"/> 
      <xs:element type="xs:string" name="image"/> 
      <xs:element type="xs:string" name="metadatamodificationdate"/> 
      <xs:element type="xs:byte" name="pagetotal"/> 
      <xs:element type="xs:string" name="publisher"/> 
      <xs:element type="xs:string" name="publishercity"/> 
      <xs:element type="xs:string" name="publishercountry"/> 
      <xs:element type="xs:string" name="sponsor"/> 
      <xs:element type="xs:string" name="title"/> 
      <xs:element type="xs:string" name="titlelargerentity"/> 
      <xs:element type="xs:float" name="datemonth"/> 
      <xs:element type="xs:string" name="datetype"/> 
      <xs:element type="xs:float" name="dateyear"/> 
      <xs:element type="xs:string" name="era"/> 
      <xs:element type="xs:string" name="language" minOccurs="0" maxOccurs="unbounded"/> 
      </xs:sequence> 
      <xs:attribute type="xs:byte" name="modid"/> 
      <xs:attribute type="xs:short" name="recordid"/> 
     </xs:complexType> 
     </xs:element> 
    </xs:schema> 

コード内のxsd:schemaの問題点は何ですか?何か不足していますか? 2行目のために検証されていませんか?

答えて

2

要素宣言は不十分が形成されている場合、このエラーが発生します。要素宣言に属さない文字またはキーワードを探します。

あなたの場合、descriptionの宣言に漂白/があります。

<xs:element type="xs:string" name="description" minOccurs="0" maxOccurs="unbounded"/> 

変更

<xs:element type="xs:string" name="description"/ minOccurs="0" maxOccurs="unbounded"/> 

し、エラーを解消します。

関連する問題