dtd 屬性 屬性值默認
阿新 • • 發佈:2017-10-17
clas 網站 cast win als 分享 讀書 類型 images
禮悟:
好好學習多思考,尊師重道存感恩。葉見尋根三二一,江河湖海同一體。
虛懷若谷良心主,願行無悔給最苦。讀書鍛煉強身心,誠勸且行且珍惜。
xml:1.0
os:windows7 x64
ide:MyEclipse 2017
符合dtd約束的xml文件
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE shopping [ <!ELEMENT book (name,price,count,comment)> <!ELEMENT name (#PCDATA)> <!ELEMENT price (#PCDATA)> <!ELEMENT count (#PCDATA)> <!ELEMENT comment (#PCDATA)> <!-- comment標簽的 flag屬性 字符串類型 缺省值/默認值 --> <!ATTLIST comment flag CDATA "true" > ]> <shopping> <book> <name>了凡四訓</name> <price>100</price> <count>3</count> <comment></comment> </book> <book> <name>孟子</name> <price>200</price> <count>5</count> <!-- flag屬性不寫都可以 --> <comment></comment> </book> <book> <name>靈樞</name> <price>300</price> <count>7</count> <!-- flag屬性的值 自定義也可以 --> <comment flag="false"></comment> </book> </shopping>
myeclipse查看效果
瀏覽器查看效果
xml優秀,值得學習。在w3cschool網站中,可以全面地學習dtd。
學習資源:itcast和itheima視頻庫。如果您有公開的資源,可以分享給我的話,用您的資源學習也可以。
博文是觀看視頻後,融入思考寫成的。博文好,是老師講得好。博文壞,是 給最苦 沒認真。
dtd 屬性 屬性值默認