我正在做的假設是您試圖通過顯示其不同的內容模型來定義標籤。首先,通過接收文本,你必須將其內容定義爲混合。從那裏,你可以使用重複的選擇,列出了所有其他元素,如IMG,B,G1,G2等
我顯示從XHTML XSD的摘錄:
<xs:element name="p">
<xs:complexType mixed="true">
<xs:complexContent>
<xs:extension base="Inline">
<xs:attributeGroup ref="attrs" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:complexType name="Inline" mixed="true">
<xs:annotation>
<xs:documentation>
"Inline" covers inline or "text-level" elements
</xs:documentation>
</xs:annotation>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="inline" />
<xs:group ref="misc.inline" />
</xs:choice>
</xs:complexType>
等。
一個很好的學習可能是看看XTHML XSD。您可以使用XSD編輯器來調查與標籤關聯的結構。
這就是我一直在尋找的!謝謝。 – Harini 2012-04-05 06:05:15