Dr. AIT ISE Web Technology MODEL PAPER SOLVED

Dr. AIT ISE Web Technology MODEL PAPER SOLVED, DrAmbedkar Institute of Technology

 

  1. Define document type definition? Describe the approach of element declaration in DTD.

A DTD is a set of structural rules called declarations. These rules specify a set of elements, along with how and where they can appear in a document

<!keyword … >

There are four possible declaration keywords:

ELEMENT, ATTLIST, ENTITY, and NOTATION

<!ELEMENT element_name(list of child names)>

e.g.,

<!ELEMENT memo (from, to, date, re, body)>

This element structure can describe the document tree structure shown below.

  • Child elements can have modifiers,

_ + -> One or more occurrences

_ * -> Zero or more occurrences

_ ? ->Zero or one occurrences

Ex: consider below DTD declaration

<!ELEMENT person (parent+, age, spouse?, sibling*)>

_ One or more parent elements

_ One age element

_ Possible a spouse element.

_ Zero or more sibling element.

  • Leaf nodes specify data types of content of their parent nodes which are elements
  1. PCDATA (parsable character data)
  2. EMPTY (no content)
  3. ANY (can have any content)

<!ATTLIST element_name attribute_name attribute_type [default

_value]> More than one attribute

< !ATTLIST element_name attribute_name1 attribute_type

default_value_1 attribute_name 2 attribute_type default_value_2…>

_ Attribute type :There are ten different types, but we will consider only CDATA

_ Possible Default value for attributes:

Value – value ,which is used if none is specified

#Fixed value – value ,which every element have and can‘t be changed

# Required – no default value is given ,every instance must specify a value

#Implied – no default value is given ,the value may or may not be specified

Example :

<!ATTLIST car doors CDATA “4”>

<!ATTLIST car engine_type CDATA #REQUIRED>

<!ATTLIST car make CDATA #FIXED “Ford”>

<!ATTLIST car price CDATA #IMPLIED>

<car doors = “2” engine_type = “V8”>

</car>

  1. Explain the XML document structure.

An XML document consists of three parts, in the order given:

  • An XML declaration (which is technically optional, but recommended in most normal cases)
  • A document type declaration that refers to a DTD (which is optional, but required if you want validation)
Download Tag ,
Download Category ,

Reviews

0 reviews
5 stars
0
4 stars
0
3 stars
0
2 stars
0
1 star
0

You must log in and be a buyer of this download to submit a review.

Error: Please enter a valid email address

Error: Invalid email

Error: Please enter your first name

Error: Please enter your last name

Error: Please enter a username

Error: Please enter a password

Error: Please confirm your password

Error: Password and password confirmation do not match