In this post you can find Complete and recently updated Correct Question and answers of XML. All Answers updated regularly with new questions. Upwork
test answers of 2016.
Question:* What does "XML" stand for?
Answer: • Extensible Markup Language
Question:* All attributes must be separated by:
Answer: • Whitespace.
Question:* What are the basic constructs of an XML document?
Answer: • Tagged elements that can be nested, attributes for elements, and the text
Question:* What does ' ' stand for, and why is it used?
Answer: • Non-breaking space': It tells the parser that this particular piece of whitespace is worth rendering
Question:* Which of the following is a positive reason to use a schema?
Answer: • Programs, CSS, XSL, etc. can assume a certain structure, therefore making them simpler
Question:* How can you render XML in a browser with styling, without changing the original document?
Answer: • By linking the document to an external CSS/XSL document, then opening it in a browser
Question:* Which of the following is well-formed?
Answer: • <cat> <octopus type="octocat">funny joke</octopus> </cat>
Question:* Which of the following is true about the XML schema data type xs:anyURI
Answer: • (All of these choices.)
Question:* Which of the following is an XML query language?
Answer: • XPath
Question:* <!DOCTYPE message SYSTEM "newxml.dtd"> in an XML document does what?
Answer: • Indicates where the DTD is.
Question:* In a DTD, what is the difference between CDATA and PCDATA?
Answer: • PCDATA will be treated as general XML input, CDATA will be treated as a string
Question:* True or False? In its current state, XML is meant to be a replacement for HTML.
Answer: • False
Question:* What is XML used for?
Answer: • Data exchange and representation
Question:* What does an XML document have?
Answer: • A tree structure, a flexible schema, an implied ordering, and a way to query data called XPath
Question:* <!-- is the start of...
Answer: • A comment
Question:* XSD is written in:
Answer: • XML
Question:* Which of the following appears first in a DTD?
Answer: • DOCTYPE
Question:* Generally speaking, how is an XML document structured?
Answer: • As a hierarchical tree of nodes
Question:* What is XHTML's primary intended use?
Answer: • To make HTML more extensible and produce web documents that can be read by an XML parser
Question:* XML parsers check if the XML document is:
Answer: • Well-formed and validating
Question:* How does XPath view a XML document?
Answer: • As a tree
Question:* What kind of file does SVG represent?
Answer: • An image
Question:* What is "xmllint"?
Answer: • A command line XML tool for Linux/UNIX
Question:* How do you reference '>' in an XML document without using it as an XML character? (e.g., how do you escape '>' in XML?)
Answer: • >
Question:* In a DTD, how does one say that an attribute must exist in the XML document?
Answer: • add #REQUIRED to DTD
Question:* If one wants a value of the 'Age' attribute for an element to conform to the integer format, and wants the 'Age' attribute to be required, which of the following is the XML code in an XSD file that defines this?
Answer: • <xsd:attribute name="Age" type="xsd:integer" use="required"/>
Question:* I have a person element, with gender, address, and GPA specified as children in the DTD. What is the code that specifies that the contents of the gender element should be treated as an unparsed string?
Answer: • #CDATA
Question:* At the minimum, what must an attribute for an element contain?
Answer: • A unique name (within the element), an equal sign, and a set of quotes.
Question:* DTD includes the specifications about the markup that can be used within the document, the specifications consists of all EXCEPT:
Answer: • The browser name
Question:* What is a document type definition, also known as a DTD?
Answer: • Rules for an XML document
Question:* Which of the following is the major difference between an HTML document and an XML document?
Answer: • HTML documents have predefined elements, whereas XML documents do not
Question:* XML document by default preserves white-space characters in element content.
Answer: • True
Question:* If I have an element named 'student' and I set the XML code to maxOccurs="unbounded" in the XSD schema to this subelement, what will this do?
Answer: • It means there must be at least one student element and there is no limit to how many student elements there can be.
Question:* If I have a person element with a single gender, a single address, and a single gpa as children, which of the following would you put in the DTD to specify that gpa is optional?
Answer: • (gpa?)
Question:* The number of attributes for an element in a XML Document does NOT matter if:
Answer: • Each attribute is unique
Question:* In a DTD, how would you describe the spec, "The element 'a' contains one 'b' element, one or more 'c' elements, and optionally a 'd' element, in that order."
Answer: • <!ELEMENT a (b, c+, d?) >
Question:* Which of the following is the least flexible of the schema languages?
Answer: • DTD
Question:* An XML declaration must consist of which of the following?
Answer: • Version
Question:* Which of the following is a similarity between XSLT, XQuery, XLink and XPointer?
Answer: • XPath as component
Question:* Why is this XHTML wrong? <div class="div1" style="color: blue;" class="bodyText"></div>
Answer: • An element's attributes must each be unique within the element
Question:* What does the XML declaration have to consist of?
Answer: • XML version
Question:* maxOccurs and minOccurs can be considered as:
Answer: • occurence constraints
Question:* Which of these is the proper syntax for setting multiple values on an attribute?
Answer: • Attributes cannot have multiple values
Question:* Which of the following is NOT a benefit of using XML?
Answer: • Ability to work easily with irregular data
Question:* What does XSL most accurately do?
Answer: • Traverse XML documents and output other documents
Question:* <Shirt brand="American Eagle price="30" > The attributes in the element are NOT correct because:
Answer: • Neither the @brand attribute nor the element itself are closed properly.
Question:* Which of these characters is illegal in XML?
Answer: • &
Question:* In a DTD, how would you describe the spec, "The element 'doc' contains one 'body' element, preceded by an optional 'front' element and followed by an optional, repeatable 'appendix' element."
Answer: • <!ELEMENT doc (front?, body, appendix*) >
Question:* Which of the following is NOT a demonstrable benefit of using XML Schemas instead of DTDs?
Answer: • XML Schemas are easier to write.
Question:* Which of these is the correct syntax of the XML declaration?
Answer: • <?xml version="1.0"?>
Question:* Which of the following is an empty element tag?
Answer: • <Jeans Brand="American Eagle" Price="35" Store="Prudential"/>
Question:* In an XSD, how would you describe the spec, "The element 'a' must contain one 'b' element, one or more 'c' elements, and optionally a 'd' element, in that order."
Answer: • <xs:element name="a"> <xs:complexType> <xs:sequence> <xs:element name="b"/> <xs:element name="c" minOccurs="1" maxOccurs="unbounded"/> <xs:element name="d" m
Question:* Which of the following metaphors most accurately describes an element contained by another element?
Answer: • The second element is the child of the first
Question:* Which of the following is NOT a schema language?
Answer: • XLink
Question:* If the validating parser outputs "not valid" during the validating process, what does this mean?
Answer: • The XML document does not adhere to the specified schema.
Question:* True or False: You can refine an external XSD schema inside of an XML file, as you can with a DTD.
Answer: • False
Question:* If I have an element named 'students' and the XSD schema specifies minOccurs="0" but not maxOccurs for it, how will it be parsed?
Answer: • The student subelement will be optional and the maximum occurence of the student subelement will be one
Question:* XML Namespaces provide a method to avoid element name conflicts. Which of the following is a correct way to declare namespaces in a valid XML document.
Answer: • <n1:element xmlns:n1="http://www.w3.org/TR/html4/">
Question:* What is the error that a validating XML parser outputs if the XML document does NOT adhere to the content specific specification?
Answer: • Not valid
Question:* Which of the following can you NOT control with a DTD?
Answer: • Length of attributes
Question:* In an XML schema, to limit a user-defined type to a set of pre-defined options, you would use:
Answer: • An xs:enumeration inside an xs:restriction
Question:* What does it mean to say that an XML document has an 'implied order'?
Answer: • Even without a schema, all text-based files have an implied order
Question:* What rules are present in XSDs but NOT in DTDs?
Answer: • Constraints on element values, key decorations, full namespace support
Question:* Which of the following is NOT a built-in XML schema data type?
Answer: • xs:object
Question:* In a DTD, what does "<!ELEMENT a ANY >" most precisely mean?
Answer: • Element 'a' may contain anything, or nothing.
Question:* What does the following XPath 2.0 select? //body//w[following-sibling::c]
Answer: • Any element w that is a descendant of any element body, of which the next sibling element is element c
Question:* Ampersand sign "&" and less than "<" are allowed in
Answer: • Comment
Question:* Which of the following best describes the difference between a valid XML document and a well formed XML document?
Answer: • A valid XML document must adhere to the same basic constructs of an XML document as well as adhering to a schema.
Question:* Which of the following is not a kind of node in the XML DOM?
Answer: • A child node