1
<review rating="5"reviewer="Peterson Johnston">
代碼應該是這樣的嗎?如何將其轉換爲dtd屬性?
<!ATTLIST review then i don't really know how the syntax goes.
<review rating="5"reviewer="Peterson Johnston">
代碼應該是這樣的嗎?如何將其轉換爲dtd屬性?
<!ATTLIST review then i don't really know how the syntax goes.
這可能是這樣的:
<!ATTLIST review rating NMTOKEN #REQUIRED>
<!ATTLIST review reviewer CDATA #REQUIRED>
或
<!ATTLIST review rating NMTOKEN #REQUIRED>
reviewer CDATA #REQUIRED>
的語法(一個屬性)是:
<!ATTLIST element-name attribute-name attribute-type attribute-usage>
號通常NTOKEN
(無空格或特殊字符allo星期三)和字符串CDATA
。你也可以有一個NMTOKENS (option1 | option2)
的枚舉。屬性類型也可以是#IMPLIED
(可選),#FIXED "value"
,默認值"value"
。