MCQs Test!! VB Basic Test !! Essentials of VB !! Creating User Services !! function !! Anatomy !! GK March-2019 !! DATA TYPES IN JAVA !! Classes ,Constructor ,Methods,Inheritance !! Ecology-I !! Biology 2019 !! Gk april 2019 !! Biology (living world) !! Plant anatomy !! CELL STRUCTURES AND FUNCTION !! General biology !! Human physiology !! Data structure !! Ecology-II !! GK TEST !! Reproduction in plants !! Human reproduction !! The ABC of C !! Operating system set1 !! Operating system set2 !! Gk and current affairs !! Animal kingdom !! Number system !! Animal kingdom-II !! Gk TEST-III !! Number series !! Microorganisms !! Interview question in c !! Time and Work !! Percentage !! General history !! Average !! Cells !! Locomotion and Movement !! paging !! Bacteriology !! Page replacement policy !! Secondary memory and Disk scheduling !! Introduction of Nervous System and neurons !! Plant harmones !! Transport and Mineral Nutrition in Plants !! Neurotransmitters !! Modern Indian History !! Photosynthesis in Plants !! Modern Indian History-II !! Plant respiration !! Environment & Biodiversity !! Environment & Biodiversity - II !! Algae, Bryophytes, Pteridophytes !! Area !! Cricket !! Days of the Year (India and the World) !! Plant Pathology - I !! Indian Transport System !! Plant Pathology - II !! Aptitude !! Biology !! Botany !! C language !! Computer Science !! Core Java !! Gate !! GK !! Mysql !! Operating system !! Physics !! VB-Visual Basic !! Zoology

DTD



Totel:9 Click: 1 2
DTD Interview Questions And Answers

Page 1

 We can perform validation using DTD in XML with internet explorer 5 and its higher version.


To validate XML document using XML parser : We can perorm validation using with XML parser in XML document.Vaidation performa is like that suppose that when you try to open XML document than may be XML parser can generate error.

 You can findout error code, error text, or line that cause error by accessing the parseError object.

 We can use load() method to validate files and use loadXML() method to validate strings.

Example:

var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");

xmlDoc.async="false";

xmlDoc.validateOnParse="true";

xmlDoc.load("note_dtd_error.xml");

document.write("<br />Error Code: ");

document.write(xmlDoc.parseError.errorCode);

document.write("<br />Error Reason: ");

document.write(xmlDoc.parseError.reason);

document.write("<br />Error Line: ");

document.write(xmlDoc.parseError.line); 

To turnoff validation : We can turnoff validation in XML document by using an code in XML Parser like: validateOnParse="false".

Example:

var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");

xmlDoc.async="false";

xmlDoc.validateOnParse="false";

xmlDoc.load("document_dtd_error.xml");

document.write("<br />Error Code: ");

document.write(xmlDoc.parseError.errorCode);

document.write("<br />Error Reason: ");

document.write(xmlDoc.parseError.reason);

document.write("<br />Error Line: ");

document.write(xmlDoc.parseError.line);

 We can say that entities are nothing other than variable we use entities to define shortname of big standard text and also use to define special character.Entity consist of these three terms &(ampersand), entitiy name and ;(semicolon).

To declare entity internally : 

Syntax:

<!ENTITY entity-name "entity-value">

Example:

DTD Example:

<!ENTITY writer "Micky Mouse">

<!ENTITY copyright "Copyright WaltDisney">

XML example:

<author>&writer;&copyright;</author> 

To declare entity externally : 

Syntax:

<!ENTITY entity_name SYSTEM "URI/URL">

Example:

A DTD Example:

<!ENTITY writer SYSTEM "http://www.r4r.co.in/entities.dtd">

<!ENTITY copyright SYSTEM "http://www.r4r.co.in/entities.dtd">

A XML example:

<author>&writer;&copyright;</author>

 XML doesn't has specific rules about where we use child elements and where  we use attributes.So, we can place them as our requirement.

 In support of that statement I have given you example.Which definitily suggest you where we use child elements and attributes.

Example:

 <person sex="male">

  <firstname>Sumit</firstname>

  <middlename>kumar</middlename>

  <lastname>Garg</lastname>

</person>

 In this example we use sex as an attribute and attribute value is "male".

<person>

  <sex>male</sex>

  <firstname>Sumit</firstname>

  <middlename>Kumar</middlename>

  <lastname>Garg</lastname>

</person>

 In this example sex is an child element and element value is "male".

 But I advise you to use attribues in HTML and use child elemens in case of XML.


 We declare attribute in an DTD by using an keword called ATTLIST.

 Now. I show you how to define a attribute in a DTD.

Syntax:

<!ATTLIST element-name attribute-name attribute-type default-value>

 We declare attribute in DTD like that:

<!ATTLIST status type CDATA "true">

 We declare attribute in XML like that:

<status type="true" />


Default Attribute Value : You can also set the default attribute value like that:

DTD:

<!ELEMENT rectangle EMPTY>

<!ATTLIST rectangle width CDATA "10">

Valid XML:

<rectangle width="50" />

 This example set default value of rectangle is 10. 

# Required : We use # Required keyword if you don't want to set default value of an attribute.

Syntax:

<!ATTLIST element_name attribute_name attribute_type #REQUIRED>

Example:

DTD:

<!ATTLIST SSN number CDATA #REQUIRED>

Valid XML:

<SSN number="0007" />

Invalid XML:

<SSN />

 Where, SSN stands for Social Security Number. 

#IMPLIED : Use this when don't want user to include attribute and also don't want to set default value.

Syntax


<!ATTLIST element-name attribute-name attribute-type #IMPLIED>

Example:

DTD:

<!ATTLIST contact fax CDATA #IMPLIED>

Valid XML:

<contact fax="091-123456" />

Valid XML:

<contact />

#FIXED : If you want that attribute value not be changed by the users in future.Than we can perform that task with the help of FIXED keyword.

Syntax:

<!ATTLIST element_name attribute_name attribute_type #FIXED "value">

Example:

DTD:

<!ATTLIST indian company CDATA #FIXED "Microsoft">

Valid XML:

<indian company="R4R" />

Invalid XML:

<indian company="abc" />  

Enumerated Attribute Values : Use this when we want to use some fixed values.

Syntax:

<!ATTLIST element_name attribute_name (en1|en2|..) default_value>

Example:

DTD:

<!ATTLIST payment type (check|DD|cash) "cash">

XML example:

<payment type="check" />

       or

<payment type="DD" /> 

       or

<payment type="cash" />


Goto Page:

1 2
DTD Objective Questions And Answers

DTD Objective Questions And Answers

DTD Interview Questions And Answers

DTD Subjective Questions And Answers


R4R,DTD Objective fresher and experienced, DTD Subjective fresher and experienced ,DTD Interview Questions And Answers,DTD fresher and experienced,DTD Interview fresher and experienced ,DTD Questions fresher and experienced,DTD Answers fresher and experienced