XML Questions: Trivia Quiz!

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Ghanshyam
G
Ghanshyam
Community Contributor
Quizzes Created: 1 | Total Attempts: 214
Questions: 10 | Attempts: 214

SettingsSettingsSettings
XML Questions: Trivia Quiz! - Quiz

.


Questions and Answers
  • 1. 

    Which of the following XML documents are well-formed?

    • A.

      <firstElement>some text goes here <secondElement>another text goes here</secondElement> </firstElement>  

    • B.

      <firstElement>some text goes here</firstElement> <secondElement> another text goes here</secondElement>  

    • C.

      <firstElement>some text goes here <secondElement> another text goes here</firstElement> </secondElement>

    • D.

      </firstElement>some text goes here </secondElement>another text goes here <firstElement>

    Correct Answer
    B. <firstElement>some text goes here</firstElement> <secondElement> another text goes here</secondElement>  
    Explanation
    The given XML document is well-formed because it follows the rules of XML syntax. It has a root element, , which is properly closed with . It also has a nested element, , which is also properly closed with . The text content is placed within the elements, and there are no syntax errors or inconsistencies in the document.

    Rate this question:

  • 2. 

    Attribute standalone="no" should be included in XML declaration if a document:

    • A.

      Has processing instructions

    • B.

      Is linked to an external XSL stylesheet

    • C.

      Has external general references

    • D.

      Has an external DTD

    Correct Answer
    D. Has an external DTD
    Explanation
    The attribute standalone="no" should be included in the XML declaration if the document has an external DTD. This attribute is used to indicate whether the document relies on an external DTD or not. By including standalone="no", it signifies that the document is not self-contained and requires the presence of the external DTD for proper validation and interpretation.

    Rate this question:

  • 3. 

    To use the external DTD we have the syntax:

    • A.

      <?xml version=”A.0” standalone=”no”?> <! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>  

    • B.

      <?xml version=”A.0” standalone=”yes”?> <! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>

    • C.

      <?xml version=”A.0” standalone=”no”?> <! DOCTYPE DOCUMENT “order.dtd”?>

    • D.

      <?xml version=”A.0” standalone=”yes”?> <! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>

    Correct Answer
    A. <?xml version=”A.0” standalone=”no”?> <! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>  
    Explanation
    The correct answer is "". This is the correct syntax for using an external DTD in an XML document. The "DOCTYPE" declaration specifies the type of document and the location of the DTD file. In this case, the DTD file is named "order.dtd" and it is located in the same directory as the XML document. The "SYSTEM" keyword is used to indicate that the DTD file is an external file. The "standalone" attribute is set to "no" to indicate that the document depends on the external DTD for its structure and validation.

    Rate this question:

  • 4. 

    Which option is true about session scope?

    • A.

      Objects are accessible only from the page in which they are created

    • B.

      Objects are accessible only from the pages which are in same session

    • C.

      Objects are accessible only from the pages which are processing the same request

    • D.

      Objects are accessible only from the pages which reside in same application

    Correct Answer
    B. Objects are accessible only from the pages which are in same session
    Explanation
    Session scope refers to the lifespan of an object in a web application. When an object is stored in session scope, it is accessible only from the pages that are in the same session. This means that the object can be accessed and manipulated by any page within the same session, but not by pages in different sessions. This allows for the sharing of data and information between multiple pages within a single session, providing a way to maintain state and pass data between different parts of an application.

    Rate this question:

  • 5. 

    Consider the following statement containing regular expressions var text = "testing: 1, 2, 3"; var pattern = /\d+/g; In order to check if the pattern matches, the statement is

    • A.

      Text==pattern

    • B.

      Text.equals(pattern)

    • C.

      Text.test(pattern)

    • D.

      Pattern.test(text)

    Correct Answer
    D. Pattern.test(text)
    Explanation
    The correct answer is "pattern.test(text)" because the test() method is used to check if a pattern matches a string. In this case, the pattern is /\d+/g which matches one or more digits, and the string is "testing: 1, 2, 3". So, by using the test() method on the pattern with the string as the argument, we can determine if the pattern matches the string.

    Rate this question:

  • 6. 

    Which one of the following function is used to start a session?

    • A.

      Start_session()

    • B.

      Session_start()

    • C.

      Session_begin()

    • D.

      Begin_session()

    Correct Answer
    B. Session_start()
    Explanation
    The correct answer is session_start(). This function is used to start a session in PHP. It initializes the session data and assigns a unique session ID to the user. Once the session is started, you can store and retrieve data in the session variables throughout the user's browsing session.

    Rate this question:

  • 7. 

    What is the constraint on the data per cookie?

    • A.

      2 KB

    • B.

      1 KB

    • C.

      4 KB

    • D.

      3 KB

    Correct Answer
    C. 4 KB
    Explanation
    The constraint on the data per cookie is 4 KB. This means that the maximum amount of data that can be stored in a single cookie is 4 kilobytes.

    Rate this question:

  • 8. 

    “request” is instance of which one of the following classes?

    • A.

      Request

    • B.

      HttpRequest

    • C.

      HttpServletRequest

    • D.

      ServletRequest

    Correct Answer
    C. HttpServletRequest
    Explanation
    The correct answer is HttpServletRequest. The reason is that HttpServletRequest is a class in Java that represents an HTTP request made by a client to a server. It provides methods to access information such as parameters, headers, and cookies of the request. Therefore, "request" is an instance of the HttpServletRequest class.

    Rate this question:

  • 9. 

    Match the following.
    1. [^...]                         p. Matches the non-word characters.
    2. [...]                            q. Matches the non-digits.
    3. \W                               r. Matches any single character not in brackets.
    4. \D                               s.  Matches any single character in brackets.

    • A.

      1-r 2-p 3-q 4-s

    • B.

      1-r 2-s 3-p 4-q

    • C.

      1-q 2-s 3-r 4-p

    • D.

      1-p 2-r 3-s 4-q

    Correct Answer
    B. 1-r 2-s 3-p 4-q
    Explanation
    The correct matching is 1-r, 2-s, 3-p, 4-q. The pattern [^...] matches any single character not in the brackets, so it matches the non-word characters. The pattern [...] matches any single character in the brackets, so it matches the non-digits. The pattern \W matches any single character that is not a word character, so it matches the non-word characters. The pattern \D matches any single character that is not a digit, so it matches the non-digits.

    Rate this question:

  • 10. 

    Which are the main features of XML?

    • A.

      Text data description

    • B.

      Human- and computer-friendly format

    • C.

      Handles data in a tree structure having one-and only one-root element

    • D.

      All mentioned above

    Correct Answer
    D. All mentioned above
    Explanation
    The main features of XML include text data description, a human- and computer-friendly format, and the ability to handle data in a tree structure with one-and only one-root element. All of these features are mentioned above, making the answer "All mentioned above" correct.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Nov 20, 2018
    Quiz Created by
    Ghanshyam
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.