Structured Web Documents in XML-Bioinformatics Using Semantic Computing-Lecture Slides, Slides of Semantics of Programming Languages

This lecture was delivered by Bhavesh Verma for Bioinformatics Using Semantic Computing course at Bhagwant University Rajasthan. It includes: Structured, Web, Documents, XML, Schemas, Successors, Extensible, Support, Namespaces, Defines, Elements

Typology: Slides

2011/2012

Uploaded on 07/11/2012

dharuna
dharuna 🇮🇳

4.7

(6)

85 documents

1 / 81

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Structured Web Documents
in XML
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51

Partial preview of the text

Download Structured Web Documents in XML-Bioinformatics Using Semantic Computing-Lecture Slides and more Slides Semantics of Programming Languages in PDF only on Docsity!

Structured Web Documents

in XML

2

XML Schemas are the Successors of DTDs

 XML Schemas will be used in most Web applications

as a replacement for DTDs. Here are some reasons:

 XML Schemas are extensible to future additions  XML Schemas are richer and more powerful than DTDs  XML Schemas are written in XML  XML Schemas support data types  XML Schemas support namespaces

An XML Schema:

defines elements that can appear in a document defines attributes that can appear in a document defines which elements are child elements defines the order of child elements defines the number of child elements defines whether an element is empty or can include text defines data types for elements and attributes defines default and fixed values for elements and attributes

5

 XML Schemas Support Data Types

 One of their greatest strengths

 With support for data types:

 It is easier to describe allowable document content  It is easier to validate the correctness of data  It is easier to work with data from a database  It is easier to define data facets (restrictions on data)  It is easier to define data patterns (data formats)  It is easier to convert data between different data types

7

 XML Schemas are Extensible

 XML Schemas are extensible, because XML is extensible

 With an extensible Schema definition you can:  Reuse your Schema in other Schemas  Create your own data types derived from the standard types  Reference multiple schemas in the same document

8

Well-Formed is not Enough

 A well-formed XML document is a document that conforms to the XML syntax rules, like:  it must begin with the XML declaration  it must have one unique root element  start-tags must have matching end-tags  elements are case sensitive  all elements must be closed  all elements must be properly nested  all attribute values must be quoted  entities must be used for special characters

10

Simple XML Document "note.xml":

Tove

Jani

Reminder

Don't forget me this weekend!

11

An XML Schema

 XML Schema file called "note.xsd" that

defines the elements of the XML document

above ("note.xml"):

 The note element is a complex type

because it contains other elements. The

other elements (to, from, heading, body)

are simple types because they do not

contain other elements.

13

 This XML document has a reference to a

Schema:

Tove Jani Reminder Don'tforget me this weekend!

14

 The Element

 The element is the root element of every XML Schema:

... ...

16

 The following fragment:

xmlns:xs= “http://www.w3.org/2001/XMLSchema”

 Indicates that the elements and data types used in the

schema come from the “http://www.w3.org/2001/XMLSchema" namespace.

 It also specifies that the elements and data types that come

from the “http://www.w3.org/2001/XMLSchema" namespace should be prefixed with xs:

17

targetNamespace="http://www.w3schools.com"

 Indicates that the elements defined by this schema

(note, to, from, heading, body.) come from the

target namespace.

For example, target namespaces would enable us to

distinguish between the declaration for element in the

XML Schema language vocabulary, and a declaration

for element in a hypothetical chemistry language

vocabulary.

The former is part of the

http://www.w3.org/2001/XMLSchema target

namespace, and the latter is part of another target

namespace.

20

xmlns=“http://www.w3schools.com”

 Indicates the default namespace