1
我有一個XML文檔是這樣的:可選元素DTD
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE school SYSTEM "">
<school>
<data>
<id>
<uid>1</uid>
</id>
<information>
<name>Michael</name>
<surename>Julius</surename>
</information>
<note>
<test>hans</test>
</note>
</data>
</school>
和DTD文件
<!ELEMENT school (data)>
<!ELEMENT data (id,information,note)>
<!ELEMENT id (uid)>
<!ELEMENT uid (#PCDATA)>
<!ELEMENT information (name,surename?)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT surename (#PCDATA)>
<!ELEMENT note (#PCDATA)> <--- unknown element type
我想與可選元素類型定義<note>
元素像
<note>
<test2>test2</test2>
</note>
或
<note>
<unknown name></unknown name>
</note>
有幫助嗎? thankz