XML interview questions

XML quiz questions

  • 1.

    What are the disadvantages of XML?

    Answer:

    Following are the disadvantages of XML:

    • XML will be just a text file if elements and attributes are not defined properly.

    • Overlapping markup is not permitted

    View
  • 2.

    What are the benefits of XML?

    Answer:

    Benefits of XML are

    • Simple to read and understand

    • XML can be done with a text editor

    • Extensibility – No fixed tags

    • Self – descriptive

    • Can embed multiple data types

    View
  • 3.

    How can I include conditional statements in XML?

    Answer:

    We cannot include conditional statement as like programming language.

    <foo if{DB}="A">bar</foo>

    This can be done by using Document Type Definition(DTD).

    <xsl:if test="@foo=’bar’">
     
    <xsl:text>Hello, world!</xsl:text>
     
    </xsl:if>

     

    View
  • 4.

    Can I replace HTML with XML?

    Answer:

    No, XML is not a replacement of HTML. XML provides an alternative approach to define own set of markup elements, and it is used for processing and storing data.

    View
  • 5.

    Whether graphics can be used in XML? If so, How?

    Answer:

    Yes, Graphics can be included in XML by using XLink and XPointer specifications. It supports graphic file formats like GIF, JPG, TIFF, PNG, CGM, EPS and SVG.

    XLink:

    <description
     
    xlink:type="simple"
     
    xlink:href="http://show.com/Cinema.gif"
     
    xlink:show="new">
     
    </description>
     
    XPointer:
     
    <description
     
    xlink:type="simple"
     
    xlink:href="http://show.com/Cinema.gif#Shownumber"
     
    xlink:show="new">
     
    </description>

     

    View
  • 6.

    What software is available for XML?

    Answer:

    There are thousands of programs available for XML and updated list will be present in http://xml.coverpages.org.

    View
  • 7.

    What are the special characters used in XML?

    Answer:

    <, > and & are the special characters used in XML. Because these characters are used for making tags.

    View
  • 8.

    Can I execute a XML?

    Answer:

    No, we cannot execute XML, and it is not a programming language to execute. It is just a markup language to represent the data.

    View
  • 9.

    What is SGML?

    Answer:

    SGML is large and powerful Standard Generalized markup Language which is used to define descriptions of the structure of different types of electronic document.

    View
  • 10.

    Why XML has been used for development?

    Answer:

    XML is used for development for following reasons:

    • Used for Database driven websites

    • Used to store data for e-commerce websites

    • Used to transport and store data on internet

    • XML is used for database and flat files

    • Generate dynamic content by applying different style sheets

    View
  • 11.

    What is well formed XML document?

    Answer:

    A well-formed XML document must follow the following rules  –

    • Every start tag should end with an end tag

    • XML tags are case sensitive

    • Empty tags are necessary to close with a forward slash

    • All tags should be properly nested

    View
  • 12.

    What is an XML Schema?

    Answer:

    An XML schema gives the definition of an XML document, and it has following:

    • Elements and attributes

    • Elements that are child elements

    • Order of child elements

    • Data types of elements and attributes

    View
  • 13.

    Who is responsible for XML?

    Answer:

    XML is a recommendation of the W3C – World Wide Web Consortium and the development are supervised by XML working group.

    View
  • 14.

    What is XSL?

    Answer:

    XSL is a language used with XML for expressing style sheets as like CSS. It describes how to display an XML document for a given type.

    View
  • 15.

    What is XML Parser?

    Answer:

    XML Parser is used to convert from XML document into an XML DOM object which can be written in Javascript.

    View
  • 16.

    What are XML Namespaces?

    Answer:

    XML namespaces are used to avoid element name conflicts, and it can be avoided by using prefix before the name.

    View
  • 17.

    How comment can be represented in XML?

    Answer:

    Comment can be represented as <!- – comments – -> as like HTML. This comment symbol is applicable for single or multiple lines.

    View
  • 18.

    What is CDATA?

    Answer:

    CDATA is unparsed character data that cannot be parsed by the XML parser. Character < and > are illegal in XML elements. CDATA section starts with <![CDATA[“ and end with “]]>”.

    View
  • 19.

    What is XML Element?

    Answer:

    An XML document contains XML Elements, and it starts from an element’s start tag to end tag. It can contain:

    • Other elements within main element

    • An Attribute

    • text

    View
  • 20.

    What are the basic rules while writing XML?

    Answer:

    These are the basic rules while writing XML:

    • All XML should have a root element

    • All tags should be closed

    • XML tags are case sensitive

    • All tags should be nested properly

    • Tag names cannot contain spaces

    • Attribute value should appear within quotes

    • White space is preserved

    View

© 2017 QuizBucket.org