xmldtd

66次阅读

共计 624 个字符,预计需要花费 2 分钟才能阅读完成。

student.dtd
<!ELEMENT students (student+) >
<!ELEMENT student (name,age,sex)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT age (#PCDATA)>
<!ELEMENT sex (#PCDATA)>
<!ATTLIST student number ID #REQUIRED>
student.xml
<?xml version=”1.0″ encoding=”UTF-8″ ?>
<!DOCTYPE students SYSTEM “student.dtd”>

<!–<!DOCTYPE students [

    <!ELEMENT students (student+) >
    <!ELEMENT student (name,age,sex)>
    <!ELEMENT name (#PCDATA)>
    <!ELEMENT age (#PCDATA)>
    <!ELEMENT sex (#PCDATA)>
    <!ATTLIST student number ID #REQUIRED>


    ]>-->

<students>


<student number="s001">
    <name>zhangsan</name>
    <age>abc</age>
    <sex>hehe</sex>
</student>

<student number="s002">
    <name>lisi</name>
    <age>24</age>
    <sex>female</sex>
</student>

</students>

正文完
 0