25

Schema languages

Embed Size (px)

DESCRIPTION

Schema languages

Citation preview

Page 1: Schema languages
Page 2: Schema languages

<?xml version=„1.0‟ encoding=“UTF-8”?>

<!-- Human Resource data-->

<HumanResource>

<!-- Information for a person-->

<Person id=„1‟ slary=“500”>

<FirstName>John</FirstName>

<MidName></MidName>

<LastName>Doe</LastName>

<Position>Manager</Position>

</Person>

</HumanResource>

Document Type

Page 3: Schema languages
Page 4: Schema languages
Page 5: Schema languages
Page 6: Schema languages
Page 7: Schema languages

<?xml version=”1.0”?>

<name>

<first>

John

</first>

<middle>

Johansen

</middle>

<last>

Doe

</last>

</name>

<!ELEMENT name (first, middle, last)>

<!ELEMENT first (#PCDATA)>

<!ELEMENT middle (#PCDATA)>

<!ELEMENT last (#PCDATA)>

Page 8: Schema languages
Page 9: Schema languages

<?xml version=”1.0”?>

<!DOCTYPE name [

<!ELEMENT name (first, middle, last)>

<!ELEMENT first (#PCDATA)>

<!ELEMENT middle (#PCDATA)>

<!ELEMENT last (#PCDATA)>

]>

<name>

<first>John</first>

<middle>Johansen</middle>

<last>Doe</last>

</name>

Page 10: Schema languages

<?xml version=”1.0”?>

<!DOCTYPE name SYSTEM “name.dtd”[

]>

<name>

<first>John</first>

<middle>Johansen</middle>

<last>Doe</last>

</name>

Page 11: Schema languages
Page 12: Schema languages

<!ELEMENT name (first, middle, last)>

Page 13: Schema languages
Page 14: Schema languages

<!ELEMENT contact (name, (address|GPS), phone, knows, description)>

<!ELEMENT description (#PCDATA | em | strong | br)*>

<!ELEMENT br EMPTY>

<!ELEMENT description ANY>

Page 15: Schema languages

Indicator Description

[none] when no cardinality indicator is used, it indicates that the element must

appear once and only once. This is the default behavior for elements used

in content models.

? Indicates that the element may appear either once or not at all

+ Indicates that the element may appear one or more times

* Indicates that the element may appear zero or more times

<!ELEMENT name (first+, middle?, last)>

Page 16: Schema languages

<!ATTLIST contacts source CDATA #IMPLIED>

Page 17: Schema languages
Page 18: Schema languages

Type Description

CDATA Indicates that the attribute value is character data. Notice that this is slightly different from

the PCDATA keyword in ELEMENT declarations.

ID Indicates that the attribute value uniquely identifies the containing element

IDREF Indicates that the attribute value is a reference, by ID, to a uniquely identifiable element

IDREFS Indicates that the attribute value is a whitespace-separated list of IDREF values

ENTITY Indicates that the attribute value is a reference to an external unparsed entity

ENTITIES Indicates that the attribute value is a whitespace-separated list of ENTITY values

NMTOKEN Indicates that the attribute value is a name token.

NMTOKENS Indicates that the attribute value is a whitespace-separated list of NMTOKEN values

Enumerated List Apart from using the default types, you can also declare an enumerated list of possible

values for the attribute.

Page 19: Schema languages
Page 20: Schema languages
Page 21: Schema languages
Page 22: Schema languages

&#169;

&#x00A9;

Page 23: Schema languages

<!ENTITY empty-gps “<latitude></latitude><longitude></longitude>”>

<!ENTITY jeff-description SYSTEM “jeff.txt”>

Page 24: Schema languages

<!ENTITY % DefaultPhoneKind “Home”>

<!ENTITY % NameDeclarations SYSTEM “name4.dtd”>

Page 25: Schema languages