 
                 
                InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. | An XML parser is used to(a) extract data from the XML file and build tree like structure.(b) check whether or not an XML document is well-formed.(c) Both (a) and (b)(d) None of the above | 
| Answer» (b) Check whether or not an XML document is well-formed. | |
| 2. | Difference between EDI and XML ? | ||||||||||||
| Answer» 
 | |||||||||||||
| 3. | Explain two softwares which are used to validate XML documents. | 
| Answer» Two important software that validates or process XML documents are as follows: 1. XML Validator is the software packages that check the XML document as per the specified DTD and give you feedback about the document. Some XML validators are as follows: (a) W3C XML Validator (b) Tidy (c) XML. com’s (d) Brown University 2. XML Parsers are the software packages, which are part of bigger applications that provide XML support. The role of an XML parser is to dissect a valid XML document to obtain actual data from the XML document. Some XML parsers are as follows: (a) SAXfSimple API for XML) (b) Expat (c) LT-XML etc. | |
| 4. | Which of the following is not an online XML validator?(a) W3C validation service(b) Tidy(c) XML.com’s(d) expat | 
| Answer» (d) expat is an online XML parser not an online XML validator. | |
| 5. | ………. refers to the preface to an XML document. | 
| Answer» Prolog refers to the preface to an XML document. | |
| 6. | An attribute is a ……….. pair contained in the start tag of the element. | 
| Answer» An attribute is a name-value pair contained in the start tag of the element. | |
| 7. | XML is used to define other languages. | 
| Answer» True XML is a meta-language, which is used to define other languages. | |
| 8. | We need a/an ………….. to create and edit an XML document. | 
| Answer» We need a/an XML parser to create and edit an XML document. | |
| 9. | You can validate an XML document by using the XML validator and …………… . | 
| Answer» You can validate an XML document by using the XML validator and XML parser. | |
| 10. | An element can be written without the end........... tag. | 
| Answer» An element can be written without the end empty tag. | |
| 11. | Write the procedure to link a stylesheet with an XML document. | 
| Answer» Using CSS with an XML Document To link an XML document with a stylesheet perform the following steps: 1. Create an XML document and save it as a file with the .xml extension. 2. Create a stylesheet and save it as a file with the .css , extension. 3. Link both the files in the XML document by using the PI. <?xml-stylesheet href = “test.css” type = “text/css”?> e.g. The following is the CSS document: People { background-color : light green; display : block; padding : 5px; font-family : arial; } Person { background-color : pink; border : 2px solid black; display : block; margin-bottom : 5px; Name { font-family : bold; display : block; } Birthdate { display : block; } Eyes { display : block; } Now, save it as test.css The following is the XML document: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type = "text/css" href = "test.css"?> <People> <Person> <Name>A</Name> <Birthdate>Jan 24, 1987</Birthdate> <Eyes>Blue</Eiyes> </Person> <Person> <Name>B</Name> <Birthdate>Dec 15, 2009</Birthdate> < Eyes >Brown</Eyes > </Person> </People> Now, save it as test1.xml | |
| 12. | XML was not designed to(a) display Web pages(b) store data(c) carry data(d) Both (b) and (c) | 
| Answer» (a) XML was designed to store and carry data, not to display Web pages. | |
| 13. | XML uses(a) Only 5 tags(b) Predefined tags(c) Custom tags(d) HTML tags | 
| Answer» (c) XML uses user-defined or custom tags. | |
| 14. | Name the root element in the following XML document:<father><child1><name> Megha </name><age> 12 </age></child1><child2><name > Mana </name><age> 15 </age></child2></father>(a) child 1(b) child 2(c) father(d) name | 
| Answer» (c) father is the root element. | |
| 15. | An XML document can be viewed in a(a) Word processor(b) Web browser(c) Notepad(d) None of these | 
| Answer» (b) An XML document can be viewed in a Web browser. | |
| 16. | Create XML markup to represent a message sent on 7 June, 2014 to Amit and Saurabh by Mohit. The message is “Submitted Successfully”. | 
| Answer» <?xml version = "1.0"?> <message date="7/6/2014"> <sender> Mohit </sender> <receiversXreceiver> Amit </receiver> <receiver> Saurabh </receiver> </receivers> <text> Submitted Successfully </text> </message> | |
| 17. | Name some languages, which are derived from XML. | 
| Answer» Some languages are as follows: 1. Ink Markup Language (InkML) 2. Business Narrative Markup Language (BNML) 3. Financial Product Markup Language (FPML) 4. Virtual Human Markup Language (VHML) . 5. Architecture Description Markup Language (ADML) 6. Artificial Intelligence Markup Language (AIML) 7. Chess Markup Language (ChessML) etc. | |
| 18. | XML is widely used for storing data. | 
| Answer» True XML is used to describe data and storing data. | |
| 19. | The way of describing XML data is(a) XML uses XML to describe data(b) XML uses a description node to describe data(c) XML uses a DTD to describe the data(d) None of the above | 
| Answer» (c) XML uses a DTD to describe XML data. | |
| 20. | In XML, ……….. cannot contain multiple values. | 
| Answer» In XML, attributes cannot contain multiple values. | |
| 21. | How is an empty element defined in XML?(a) <name> </name>(b) <name/>(c) name/(d) All of these | 
| Answer» (b) The empty tag name is followed by <name/> | |
| 22. | Create a DTD for storing book information for a library. The DTD should contain details about each book in terms of title, author (name), number of copies, all of which can store character data. The number of copies should contain two attributes named ‘inhand’ and issued which are both mandatory. | 
| Answer» <?xml version = "1.0"> <!DOCTYPE LIBRARY [ <!ELEMENT LIBRARY (BOOK +)> <!ELEMENT BOOK (TITLE, AUTHOR, NOC)> <!ELEMENT AUTHOR (NAME)> <!ELEMENT TITLE (# PCDATA)> <!ELEMENT NAME (# PCDATA)> <!ELEMENT NOC (# PCDATA)> <! ATTLIST NOC INHAND ISSUED CDATA # REQUIRED> ]> | |
| 23. | What does DTD stand for?(a) Dynamic Type Definition(b) Dynamic Type Declaration(c) Document Type Declaration(d) Document Type Definition | 
| Answer» (c) Document Type Declaration | |
| 24. | XML is extensible Meta Language. | 
| Answer» False XML is not an extensible Meta Language. It is extensible Markup Language. | |
| 25. | Write the full form of1. XML2. DTD3. SGML4. CSS | 
| Answer» Full form of given terms are as follows: 1. XML Extensible Markup Language 2. DTD Document Type Declaration 3. SGML Standardised Generalised Markup Language 4. CSS Cascading Style Sheet | |
| 26. | The combination of XML document, DTD and stylesheet is known as ………. . | 
| Answer» The combination of XML document, DTD and stylesheet is known as XML document system. | |
| 27. | An XML document can have only limited number of child elements. | 
| Answer» False XML document can have an unlimited number of child elements. | |
| 28. | XML is design to describe data. | 
| Answer» True The focus of XML is on the description of data, not its presentation. | |
| 29. | A special character can be defined as a short name given to a set of information. | 
| Answer» True When a special character is used in an XML document, it expands to its full definition. | |
| 30. | The values of the attributes are enclosed in double question marks. | 
| Answer» False The values of the attributes are enclosed in double quotation marks. | |
| 31. | The root element is a parent element of all other elements in data instance. | 
| Answer» True The root element is an element that contains all other elements in XML document. | |
| 32. | DTD is a set of rules that defines what tags appear in an HTML document. | 
| Answer» False DTD is used in XML documents. | |
| 33. | XML is a platform-independent language. | 
| Answer» True XML can run on all platforms, so it is platform-independent language. | |
| 34. | Names in XML document must start either with a letter, number or underscore. | 
| Answer» False Names in XML must start either with a letter or underscore character. | |
| 35. | Pseudo attributes are the settings that appear in prologs. | 
| Answer» True Pseudo attributes describe the overall document. | |
| 36. | XML uses a DTD to describe its data to users. | 
| Answer» True The DTD are used in XML to specify its information and data to users. | |
| 37. | ……… is used to define the structure of an XML document. | 
| Answer» DTD is used to define the structure of an XML document. | |
| 38. | The XML document is like a(a) tree structure(b) inverted tree structure(c) flat structure(d) None of the above | 
| Answer» (a) The xml document is like a tree structure. | |
| 39. | XML document structure can be divided in which two parts? What is meant by valid XML document (write three points)? Write the code to create anNameJobDepartmentCubicleSrishtiProgrammerEngineering5EAditiDesingerMarketing19T | 
| Answer» XML document structure can be divided into two parts as follows: 1. Well-formed XML document 2. Valid XML document A valid XML document means to follow several terms, such as follows: 1. It is not only a well-formed document but as well as check error against a DTD. 2. It signifies that a document is well-formed. 3. It uses XML parser, XML validator for validation. The XML code is <?xml version = "1.0" encoding = "UTF-8"?> <Employees> <Employee> <Name> Srishti </Name> <Job> Programmer </Job> <Department> Engineering </Department> <Cubicle> 5E </Cubicle> </Employee> <Employee> <Name> Aditi </Name> <Job> Designer </Job> <Department> Marketing </Department> <Cubicle> 19T </Cubicle> </Employee> </Employees> | |
| 40. | A valid XML document that follows all grammar rules is well-formed document. | 
| Answer» True A well-formed XML document means that the document has the correct XML syntax and follows proper grammar rules. | |