Skip to content

Instantly share code, notes, and snippets.

@chris-x86-64
Last active December 26, 2015 06:49
Show Gist options
  • Save chris-x86-64/7110474 to your computer and use it in GitHub Desktop.
Save chris-x86-64/7110474 to your computer and use it in GitHub Desktop.
データベース概論II 演習問題 (適当なXMLを作成する)
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE people [
<!ELEMENT people (person+)>
<!ELEMENT person (name, age, birthday, address, phone?, occupation, comment?)>
<!ATTLIST person id #REQUIRED>
<!ELEMENT name (given, surname)>
<!ELEMENT given (#PCDATA)>
<!ELEMENT surname (#PCDATA)>
<!ELEMENT age (#PCDATA)>
<!ELEMENT birthday (year, month, day)>
<!ELEMENT year (#PCDATA)>
<!ELEMENT month (#PCDATA)>
<!ELEMENT day (#PCDATA)>
<!ELEMENT address (street, province, country)>
<!ELEMENT street (#PCDATA)>
<!ELEMENT province (#PCDATA)>
<!ELEMENT country (#PCDATA)>
<!ELEMENT phone (#PCDATA)>
<!ELEMENT occupation (#PCDATA)>
<!ELEMENT comment (#PCDATA)>
]>
<people>
<person id=1>
<name>
<given>Sakuya</given>
<surname>Izayoi</surname>
</name>
<age>18</age>
<birthday>
<year>1866</year>
<month>08</month>
<day>12</day>
</birthday>
<address>
<street>Koumakan</street>
<province>Gensokyo</province>
<country>JAPAN</country>
</address>
<phone>03-1341-3983</phone>
<occupation>Maid</occupation>
<comment>This is a fictional character.</comment>
</person>
<person id=2>
<name>
<given>Reimu</given>
<surname>Hakurei</surname>
</name>
<age>15</age>
<birthday>
<year>1869</year>
<month>05</month>
<day>01</day>
</birthday>
<address>
<street>Hakurei Shrine</street>
<province>Gensokyo</province>
<country>JAPAN</country>
</address>
<phone>0120-APPLE-1</phone>
<occupation>Shrine maiden</occupation>
<comment>This is also a fictional character.</comment>
</person>
</people>
1. /people/person/name()
2. /people/person[2]/age
3. /people/person[age<20]/phone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment