90 likes | 172 Views
Document Markup. SNU IDB Lab. Table of Contents. Elements Attributes Reserved Attributes Declarations. Elements. An element consists of a start tag, an end tag, and data e.g.) Are you going to <name> Scarborough </name> failr ? Element names are case-sensitive
E N D
Document Markup SNU IDB Lab.
Table of Contents Elements Attributes Reserved Attributes Declarations
Elements • An element consists of a start tag, an end tag, and data • e.g.) Are you going to <name> Scarborough </name> failr ? • Element names are case-sensitive • Some hierarchical structures may be recursive
Elements • Content types • element content • an element that does not directly contain text, but contains other elements • mixed content • an element that contains a mixture of elements and text • data content • an element that happens to contain only text • empty element • an element that may not be allowed to contain data
Elements mixed content data content <section> <p> … </p> <p> This paragraph contains an <em>emphasized phrases</em> in the middle. </p> <p> This paragraph contains a figure <fig …/> here. </p> <list> … </list> </section> empty element element content
Attributes • Provides refined information about an element • Embedded in the element start-tag • Consists of an attribute name and an attribute value • value is enclosed by quotes • name and value are case-sensitive
Reserved Attributes • Languages • ‘xml:lang’ is reserved for storage of both language and country details • e.g.) <para xml:lang=“en”> … </para> • sub-code specify a country code • e.g.) <instruction xml:lang=“en-GB”> … <instruction>
Reserved Attributes • Significant spaces • ‘xml:space’ is reserved for distinguish space characters in elements that contain other elements from spaces in elements that contain text • possible values : ‘default’, ‘preserve’
Declarations • Contain instructions to the XML processor • Delimited by ‘<!’ and ‘>’ • Types of declarations • document type declaration • e.g.) <!DOCTYPE MyBook> • comments • e.g.> <!-- This is a comment --> • character data sections • <![CDATA[Press the <<<Enter>>> button.]]> • XML declaration • <?XML version=“1.0” encoding=“UTF-8” standalone=“yes” ?>