私は単純なXMLのためのXMLスキーマをまとめています(xmlとスキーマの両方については以下を参照してください)。しかし、私はセクションノードに関して次のようなエラーを受けています: "要素に空白を含めることはできません。コンテンツモデルは空です。" 。インターネットを閲覧すると、それが何を意味するかについて簡潔な説明が見つかりませんでしたので、修正することができます。誰も助けることができますか?"要素に空白を含めることはできません。コンテンツモデルは空です。"平均?
編集:スキーマのヘルプを提供してくれてありがとう。私は、コンテンツモデルが何であるか、なぜそれが空であるのかを簡潔に説明するのに役立つと思います。
XML:
<config>
<section name="facets">
<facet type="format" label="Format" max="4"/>
<facet type="language" max="4"/>
<facet type="pubdate" max="6" submax="8"/>
<facet type="ice_topic" label="Fiction: Topic"/>
</section>
</config>
スキーマ:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="config">
<xs:complexType>
<xs:sequence>
<xs:element name="section" type="sectionBase"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="sectionBase">
<xs:attribute name="name" type="xs:ID"/>
</xs:complexType>
<xs:complexType name="sectionFacets" >
<xs:complexContent>
<xs:extension base="sectionBase">
<xs:sequence>
<xs:element name="facet" type="sectionFacetsBaseFacet"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="sectionFacetsBaseFacet">
<xs:attribute name="label" type="xs:ID"/>
<xs:attribute name="max" type="xs:positiveInteger"/>
</xs:complexType>
<xs:complexType name="sectionFacetsFormat">
<xs:complexContent>
<xs:extension base="sectionFacetsBaseFacet"/>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="sectionFacetsPubdate">
<xs:complexContent>
<xs:extension base="sectionFacetsBaseFacet">
<xs:attribute name="submax" type="xs:positiveInteger"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
アレックス、私は正しいのであなたの答えを受け入れます。私はまだコンテンツモデルの部分が何を意味するのか理解したいと思います。何か案が? – Boaz
コンテンツモデルに関する資料を読む:http://www.stylusstudio.com/w3c/schema0/groups.htm –