Professional Documents
Culture Documents
13 XML
13 XML
Web.
H
XML
Web
Web
.
H
XML
HTML
.
H XML
XML
: /
HTML
XML
.
(<...>)
y / </>
XML
<!
>.
<!- - - ->
XML .
y
.
XML
HTML
.
XML
.
XML case-sensitive,
.
.
XML
<?xml version = 1
1.0
0 standalone = yes
yes
<>
<>
<>ProductX</>
<>1</>
<> Bellaire</>
<>5</>
<>
<> 123456789</>
<>Smith </>
<> 32.5</>
</ >
</>
<>
<> 453453453</>
<>Joyce</>
<> 20.0</>
</>
<\>
<>
<>ProductY</>
<>2</>
<>Sugarland</>
<>5</>
<>
<> 123456789</>
7.5
7.5</>
/
<>
</>
<>
<> 453453453</>
<> 20.0</>
20 0</>
</>
<>
<>333445555</>
<>10.0</>
</>
<\>
</>
document
Eo
ProductX
Bellaire
123456789
Smith
32.5
453453453
Joyce
20.0
XML :
.
XML :
.
XML :
.
10
XML
XML
standalone
.
y
y
standalone = yes
standalone = no
11
XML
y
y
XML
DTD (Document Type definition) XML .
12
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
<!DOCTYPE
!DOCTYPE [
<!ELEMENT (+)>
<!ELEMENT (, , , ?, )>
<!ELEMENT Eo (#PCDATA)>
<!ELEMENT (#PCDATA)>
<!ELEMENT (#PCDATA)>
<!ELEMENT (#PCDATA)>
<!ELEMENT (*)>
<!ELEMENT (, ?, ?, )>
<!ELEMENT (#PCDATA)>
<!ELEMENT (#PCDATA)>
<!ELEMENT (#PCDATA)>
<!ELEMENT (#PCDATA)>
]>
13
1:
2-13:
.
2: +
1
.
3: ?
0
.
8:
*
0
.
14
.
:
y
y
,
- #PCDATA (
XML) . #PCDATA
,
.
,, ,
|, .. 1|2
1 2.
.
15
XML XML
DTD
XML :
<?xml version=1.0 standalone = no?>
<DOCTYPE
SYSTEM .dtd>
XML DTD
.dtd XML .
16
DTD .
DTD
.
DTD XML
DTD
,
17
XML
XML .
XML .
.
18
1.
2.
3
3.
4.
5.
6.
7
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
8
19.
20.
21.
22
22.
23.
24.
<xsd:
<xsd: complexType>
<xsd: sequence>
<xsd: element name = street type =xsd:string/>
<xsd: element name = city type =xsd: string/>
<xsd: element name = country type =xsd:string/>
</xsd: sequence>
</xsd:
/ sd co
complexType>
p e ype
</xsd: element>
</xsd: sequence>
<xsd: attribute name =id type =xsd: integer use=required/>
</xsd: complexType>
</xsd: element>
</xsd: schema>
20
.
XML
xmlns:xsd=http://www.w3.org/2001/XMLSchema.
2 xsd
XML .
3
xsd:element name
4-6
annotation documentation
.
3 .
21
<xsd: complexType>.
p
yp
<xsd: simpleType>
XMLSchema
XMLS h
W3,
W3
Boolean, string, decimal, float, date
8
<xsd: sequence>.
9-11
<xsd:element name
xsd:>
22
11 address
.
.
17-20 .
21
required,
XML
22-24 .
23
<element
l
name=person>
0
2.
<complexType>
3
3.
<sequence>
4.
<element name=name type=string/>
5.
<element name=born type=date/>
6.
<element name=dead type=date minOccurs=0/>
7.
<element name=qualification type=string minOccurs=0/>
8.
</sequence>
/
9.
<attribute name=id type= ID use=required/>
10.
</complexType>
10
11. </element>
1.
24
1.
2.
3.
3
4.
5.
6.
7.
8.
9.
10.
11.
12.
13
13.
14.
15.
16.
17.
18.
19.
20.
26
27
3,4
3 4
CatalogType MovieType.
5-9 CatalogType ref
MovieType.
7
MovieType .
21 SimpleType
22 restriction
LangType string.
23 enumeration
LangType
.
28
1.
2.
3.
3
4.
5.
6.
7.
8.
9.
10.
11.
12.
13
13.
14.
15.
16.
17.
18.
19.
20.
21.
Schema
<originalLanguage>korean</originalLanguage>
instance
<yearOfProduction>2001</yearOfProduction>
<duration>02:03:00</duration>
<genre>Comedy</genre>
<genre>Drama</genre>
</Movie>
Movie.xsd
xsd
Movie
<Movie nationality="American">
<num>0010</num>
<titleMovie>The Sixth Sense</titleMovie>
<originalLanguage>english</originalLanguage>
g
g g
g
g
g g
<yearOfProduction>2000</yearOfProduction>
<duration>01:47:00</duration>
<genre>Drama</genre>
<genre>Thriller</genre>
</Movie>
30
22.
<Movie nationality="Korean">
23.
<num>0012</num>
24.
<titleMovie>A moment to remember</titleMovie>
25.
<originalLanguage>korean</originalLanguage>
26.
<yearOfProduction>2004</yearOfProduction>
27.
<duration>02:05:00</duration>
28.
<genre>Drama</genre>
29.
<genre>Romance</genre>
30.
</Movie>
31.
32. </Catalog>
31
document
Catalog
g
nationality
Movie
Korean
num
0002
TitleMovie
My sassy
girl
original
Language
korean
yearOfPr
oduction
2001
duration
02:03:00
genre
Comedy
genre
Drama
32
1.
2.
3.
4.
5.
6.
7.
8.
9
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
<breakfast_menu>
<food>
<name>Belgian Waffles</name>
p
$
p
<price>$5.95</price>
<description> two of our famous Belgian Waffles with plenty of real maple syrup </description>
<calories>650</calories>
</food>
<food>
<name>Strawberry Belgian Waffles</name>
<price>$7.95</price>
<description> light Belgian waffles covered with strawberries and whipped cream </description>
<calories>900</calories>
</food>
<food>
f d
<name>Berry-Berry Belgian Waffles</name>
<price>$8.95</price>
<description> light Belgian waffles covered with an assortment of fresh berries and whipped cream </description>
<calories>900</calories>
</food>
<food>
<name>French Toast</name>
<price>$4.50</price>
<description> thick slices made from our homemade sourdough bread </description>
<calories>600</calories>
</food>
<food>
<name>Homestyle Breakfast</name>
<price>$6.95</price>
i
$6 95 / i
<description> two eggs, bacon or sausage, toast, and our ever-popular hash browns </description>
<calories>950</calories>
</food>
</breakfast_menu>
34
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25
25.
26.
27.
28.
29.
30.
31.
36
1.
2.
3.
4
4.
5.
6.
7.
8
8.
9.
10.
11.
12
12.
13.
14.
15.
16
16.
17.
18.
19.
20
20.
21.
22.
23.
37
1.
XML
:
.
2.
y
XML
3.
y
XML
,
,
XML .
XML
.
4.
y
XML .
38