Do you know that? 49% of freelancers have not felt the impacts of the economic downturn next

Contact Email: teammmrem@yahoo.com

<< All Upwork (oDesk) and Elance Tests << Elance test answers << IT & Programming category

Test answers for XML 2020

(69) Last updated: February 28
Elance • IT & Programming
Questions and answers are regularly updated. Answered and not answered tests questions.

This helps getting job: Hundreds of (cover letter examples , interview questions , profile samples ) • Earn on Upwork (oDesk)
Job assistance: jobs popularityfreelance rates

Popular test answers: HTML, .Net, CSS, English, SEO, Photoshop, iOS, Java, Android, Ruby, Python, JavaScript

See all 6 tests answers updated

Find Upwork (oDesk) and Elance test answers on this website:



Collapse | Expand

69 Answered Test Questions:

1. What does "XML" stand for?

Answers:

• Standard General Markup Language

• Hypertext Transfer Markup Language

• Hypertext Markup Language

• Extensible Markup Language

2. All attributes must be separated by:

Answers:

• Quotes.

• Whitespace.

• Another attribute.

• An element.

3. What are the basic constructs of an XML document?

Answers:

• Tagged elements that may or may not be matched, attributes and text

• Tagged elements that can be nested, attributes for elements, and the text

• Tagged elements that can be nested, a fixed number of attributes per element and text

• Tagged elements that can overlap, attributes, and the content in strings

4. What does '&nbsp;' stand for, and why is it used?

Answers:

• Non-browser space': It tells browsers to ignore the character, if they're reading an XML document

• Non-breaking space': It tells the parser that it should not render this piece of whitespace

• Non-breaking space': It tells the parser that this particular piece of whitespace is worth rendering

• Non-browser space': It tells browsers to ignore the character, if they're reading any *ML document

5. Which of the following is a positive reason to use a schema?

Answers:

• Your data is irregular

• If you don't need your XML structure to be specific, it's easier to manipulate

• Programs, CSS, XSL, etc. can assume a certain structure, therefore making them simpler

• You need flexibility in the data

6. How can you render XML in a browser with styling, without changing the original document?

Answers:

• By linking the document to an external CSS/XSL document, then opening it in a browser

• By adding HTML and CSS into XML

• By saving it as a HTML document in a texeditor and opening it with a web browser

• By saving it as a XML document and opening it with a web browser

7. Which of the following is well-formed?

Answers:

• <cat> <octopus type="octocat">funny joke</octopus>

• <cat> <octopus type=octocat">funny joke</octopus> </cat>

• <cat type='maine coon"> <octopus type="octocat">funny joke</octopus> </cat>

• <cat> <octopus type="octocat">funny joke</octopus> </cat>

8. Which of the following is true about the XML schema data type xs:anyURI

Answers:

• It may contain an absolute URI.

• It can contain an absolute or relative URI with an optional fragment identifier.

• (All of these choices.)

• It may contain a relative URI.

9. Which of the following is an XML query language?

Answers:

• JSON

• XPath

• SQL

• relational algebra

10. <!DOCTYPE message SYSTEM "newxml.dtd"> in an XML document does what?

Answers:

• Indicates where the DTD is.

• Indicates where to find a validating parser.

• Indicates where the XSD is.

• Points you to a CSS styling sheet.

11. In a DTD, what is the difference between CDATA and PCDATA?

Answers:

• You can't use characters like < and & in CDATA

• PCDATA will be treated as general XML input, CDATA will be treated as a string

• You can only use CDATA for attributes

• CDATA works on any computer, PCDATA only works on PC's

12. True or False? In its current state, XML is meant to be a replacement for HTML.

Answers:

• False

• True

13. What is XML used for?

Answers:

• For design purposes

• For structuring documents

• For replacing HTML as a new standard

• Data exchange and representation

14. What does an XML document have?

Answers:

• A graph like structure, fixed schema, implied order, and no easy way to query

• A tree structure, a flexible schema, an implied ordering, and a way to query data called XPath

• A hierarchical structure, no ordering, and easy querying using SQL and relational algebra

• A table-like structure, a self-describing schema, and an implied ordering

15. <!-- is the start of...

Answers:

• A comment

• A CDATA space

• Javascript instructions

• A PCDATA space

16. XSD is written in:

Answers:

• html

• JSON

• XML

• SQL

17. Which of the following appears first in a DTD?

Answers:

• root element

• system identifier

• public indentifier

• DOCTYPE

18. Generally speaking, how is an XML document structured?

Answers:

• As a hierarchical tree of nodes

• As plaintext

• As a bitstream

• As a binary file

19. What is XHTML's primary intended use?

Answers:

• To make websites look better in Internet Explorer

• To standardize the mobile web

• To challenge the dominance of HTML5

• To make HTML more extensible and produce web documents that can be read by an XML parser

20. XML parsers check if the XML document is:

Answers:

• Well-formed and validating

• Well-formed

• Validating

• Non-validating

21. How does XPath view a XML document?

Answers:

• As a tree

• As a fixed structure

• As a schema

• As a graph

22. What kind of file does SVG represent?

Answers:

• A form

• A database

• An image

• A webpage

23. What is "xmllint"?

Answers:

• A well formed XML document

• A content specific specification

• A valid XML document

• A command line XML tool for Linux/UNIX

24. How do you reference '>' in an XML document without using it as an XML character? (e.g., how do you escape '>' in XML?)

Answers:

• &lt;

• &gt

• &amp;

• &gt;

25. In a DTD, how does one say that an attribute must exist in the XML document?

Answers:

• add comment to DTD

• add #IMPLIED to DTD

• add #PCDATA to DTD

• add #REQUIRED to DTD

26. 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?

Answers:

• <xsd:element name="Age" type="xsd:string use="required"/>

• <attribute name="Age" type="integer" use="required"/>

• <xsd:attribute name="age" type="xsd:integer" use="required"/>

• <xsd:attribute name="Age" type="xsd:integer" use="required"/>

27. 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?

Answers:

• <!ATTLIST>

• #CDATA

• #PCDATA

• <!ELEMENT>

28. At the minimum, what must an attribute for an element contain?

Answers:

• A unique name (within the element), an equal sign, and a set of quotes.

• A unique name (within the document), an equal sign, and a set of quotes.

• An equal sign, a nonunique name, and a set of quotes.

• A value, an equal sign, and a unique name.

29. DTD includes the specifications about the markup that can be used within the document, the specifications consists of all EXCEPT:

Answers:

• Element declarations

• The size of element name

• The browser name

• Entity declarations

30. What is a document type definition, also known as a DTD?

Answers:

• Rules for an XML document

• A validator for XML

• A parser for XML

• A debugger for XML document

31. Which of the following is the major difference between an HTML document and an XML document?

Answers:

• You do not need to close the tags in a XML document but you have to for the HTML document

• HTML tags describe both the structure and the styling of the document whereas XML tags only describe the content

• XML tags can be nested but HTML tags can't be nested

• HTML documents have predefined elements, whereas XML documents do not

32. XML document by default preserves white-space characters in element content.

Answers:

• True

• False

33. 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?

Answers:

• It means there must be more than one student element as a child and there is no limit to how many student children there can be.

• It means if there are too many student children, the validating parser will give you an error

• It means there must be at least one student element and there is no limit to how many student elements there can be.

• It means there must be multiple students as children and there is a limit to how many student children there can be.

34. 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?

Answers:

• (gpa +)

• (gpa*)

• (gpa # REQUIRED)

• (gpa?)

35. The number of attributes for an element in a XML Document does NOT matter if:

Answers:

• There are more than one attribute for each element

• Each attribute is unique

• Its a valid XML document

• More than one element has the same attribute

36. 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."

Answers:

• <!ELEMENT a (b, c*, d?) >

• <!ELEMENT a (b? c+, d?) >

• <!ELEMENT a (b, c, d) >

• <!ELEMENT a (b, c+, d?) >

37. Which of the following is the least flexible of the schema languages?

Answers:

• Schematron

• DTD

• XSD

• RELAX-NG

38. An XML declaration must consist of which of the following?

Answers:

• Encoding and standalone

• Version and standalone

• Encoding

• Version

39. Which of the following is a similarity between XSLT, XQuery, XLink and XPointer?

Answers:

• Path expressions

• Output formatting

• XPath as component

• Full-featured

40. Why is this XHTML wrong? <div class="div1" style="color: blue;" class="bodyText"></div>

Answers:

• The @style attribute must come at the end of the element

• An element's attributes must each be unique within the element

• An element cannot belong to multiple classes

• div' is not part of the XHTML namespace

41. What does the XML declaration have to consist of?

Answers:

• <?xml-stylesheet href="xml.css" type="text/css"?>

• <XML> ... </xml>

• <body> ... </body>

• XML version, encoding, and standalone

• XML version

42. maxOccurs and minOccurs can be considered as:

Answers:

• attribute constraints

• min and max values constraints

• occurence constraints

• element constraints

43. Which of these is the proper syntax for setting multiple values on an attribute?

Answers:

• <myElement myAttribute="value1" myAttribute="value2"/>

• <myElement myAttribute="value1, value2"/>

• <myElement myAttribute="value1 value2"/>

• Attributes cannot have multiple values

44. Which of the following is NOT a benefit of using XML?

Answers:

• Ability to define document structures via schemas

• Ability to work easily with irregular data

• Ability to read and edit documents on almost any system

• Unicode support

45. What does XSL most accurately do?

Answers:

• Traverse XML documents and output other documents

• Traverse XML documents and output XPath queries

• Make sure your XML is valid

• Turn an image (such as a JPG) into an SVG

46. <Shirt brand="American Eagle price="30" > The attributes in the element are NOT correct because:

Answers:

• The shirt has a value of american eagle but the attribute name is missing.

• The brand attribute is missing a value.

• The brand and the price attributes aren't separated properly.

• Neither the @brand attribute nor the element itself are closed properly.

47. Which of these characters is illegal in XML?

Answers:

• '

• ^

• "

• &

48. 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."

Answers:

• <!ELEMENT doc (front?, body, appendix*) >

• <!ELEMENT doc (front, body, appendix*) >

• <!ELEMENT doc (body, appendix*) >

• <!ELEMENT doc (body, front?, appendix*) >

49. Which of the following is NOT a demonstrable benefit of using XML Schemas instead of DTDs?

Answers:

• XML Schemas provide an object-oriented approach to structuring data.

• XML Schemas are easier to write.

• You can transform an XML Schema with XSLT.

• Use of built-in and user-defined data types.

50. Which of these is the correct syntax of the XML declaration?

Answers:

• <?xml version="1.0" />

• None of the above

• <xml version="1.0" />

• <?xml version="1.0"?>

51. Which of the following is an empty element tag?

Answers:

• <Jeans Brand="Guess" Price="25" Store="South Shore Plaza">

• <Jeans Brand="American Eagle" Price="35" Store="Prudential"/>

• <Jeans>

• <Jeans Brand="Abercrombie" Price"40" Store="Copley"></Jeans>

52. 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."

Answers:

• <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

• <xs:element name="a"> <xs:simpleType> <xs:sequence> <xs:element name="b"/> <xs:element name="c" minOccurs="1" maxOccurs="unbounded"/> <xs:element name="d" mi

• <xs:element name="a"> <xs:complexType> <xs:group> <xs:element name="b"/> <xs:element name="c" minOccurs="1" maxOccurs="unbounded"/> <xs:element name="d" minO

• <xs:element name="a"> <xs:complexType> <xs:sequence> <xs:element name="b"/> <xs:element name="c" maxOccurs="unbounded"/> <xs:element name="d"/> </xs:sequence&gt

53. Which of the following metaphors most accurately describes an element contained by another element?

Answers:

• The first element is an attribute of the second

• The second element is the child of the first

• The second element is a descendant of the first

• They are sibling elements

54. Which of the following is NOT a schema language?

Answers:

• XLink

• XSD

• RELAX NG

• Schematron

55. If the validating parser outputs "not valid" during the validating process, what does this mean?

Answers:

• The XML document doesn't have basic structures that an XML document should have.

• You forgot to specify where the DTD is.

• The XML document is not well formed.

• The XML document does not adhere to the specified schema.

56. True or False: You can refine an external XSD schema inside of an XML file, as you can with a DTD.

Answers:

• TRUE

• False

57. If I have an element named 'students' and the XSD schema specifies minOccurs="0" but not maxOccurs for it, how will it be parsed?

Answers:

• The student subelement will be required and the maximum occurence of the student subelement will be unlimited

• The student subelement will be optional and the maximum occurence of the student subelement will be one

• The student subelement will be implied and the maximum occurence of the student subelement will be unlimited

• The student subelement will be optional and the maximum occurence of the student subelement will be unlimited

58. 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.

Answers:

• <n1:element n1="http://www.w3.org/TR/html4/">

• <namespaces n1="http://www.w3.org/TR/html4/" n2="http://www.w3schools.com/furniture"></namespaces>

• <n1:element xmlns:n1="http://www.w3.org/TR/html4/">

• <n1:element namespace:n1="http://www.w3.org/TR/html4/">

• <?xml version="1.0" namespace="n1=http://www.w3.org/TR/html4/;n2="http://www.w3schools.com/furniture"?>

59. What is the error that a validating XML parser outputs if the XML document does NOT adhere to the content specific specification?

Answers:

• Not well formed

• Exception error

• Parsing error

• Not valid

60. Which of the following can you NOT control with a DTD?

Answers:

• Where text is and is not allowed

• How many instances of an element are present

• Order of elements

• Length of attributes

61. In an XML schema, to limit a user-defined type to a set of pre-defined options, you would use:

Answers:

• An xs:pattern inside an xs:restriction

• Any of the above

• An xs:enumeration inside an xs:restriction

• An xs:length inside an xs:restriction

62. What does it mean to say that an XML document has an 'implied order'?

Answers:

• None of these

• Even without a schema, all text-based files have an implied order

• XML documents do not have an implied order

• It's actually unordered because of XML's fixed schema

63. What rules are present in XSDs but NOT in DTDs?

Answers:

• tree structure, parent elements, CSS, key decorations

• Pointers, IRefs, type values

• Constraints on element values, key decorations, full namespace support

• Occurrences of elements, attributes names, number of tags nested

64. Which of the following is NOT a built-in XML schema data type?

Answers:

• xs:boolean

• xs:gMonthDay

• xs:base64binary

• xs:object

65. In a DTD, what does "<!ELEMENT a ANY >" most precisely mean?

Answers:

• Element 'a' may contain anything in the schema.

• Element 'a' may contain anything.

• Element 'a' may have any attributes.

• Element 'a' may contain anything, or nothing.

66. What does the following XPath 2.0 select? //body//w[following-sibling::c]

Answers:

• Any element w that is a descendant of any element body, of which the next sibling element is element c

• Any element w that is a descendant of the root body element, of which any sibling element is element c

• Nothing; it is invalid XPath

• Any element w that is a child of any element body, of which the next sibling element is element c

67. Ampersand sign "&" and less than "<" are allowed in

Answers:

• None of above

• All of above

• Attribute value

• Element content

• Comment

68. Which of the following best describes the difference between a valid XML document and a well formed XML document?

Answers:

• Both a valid XML document and a well formed XML document must adhere to the same basic constructs of a XML document.

• A valid XML document must adhere to the same basic constructs of an XML document as well as adhering to a schema.

• A well formed XML document has to adhere to a schema and a valid XML document only has to adhere to the basic constructs of an XML document.

• A well formed XML document has a DTD that specifies its structure, while a valid XML document has an XSD that specify the structure.

69. Which of the following is not a kind of node in the XML DOM?

Answers:

• A child node

• A processing instructions node

• An element node

• A comment node