oDesk XML Schema Test Answers 2015
·
1. Analyze the following example:
<xs:element
name="letter">
<xs:simpleType>
<xs:restriction
base="xs:string">
<xs:pattern value="([a-z][A-Z])+"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
Which of the following are acceptable
values for the <letter> element in the above defined XML schema?
Answers:
• Done
• done
• DONE
• dOnE
2. Analyze the following URI of an XML
schema:
http://www.w3.org/XML/XMLSchema/vX.Y/Ne
What does the component Ne in the
above URI identify?
Answers:
• It identifies the
XML Schema Definition Language in general.
• It identifies
the language described in the N-th version of the XSD specification.
• It identifies
the language described in the N-th edition of the XSD specification.
• None of the
above
3. Which of the following are the
correct ways to define an empty complex element in an XML schema?
Answers:
• <xs:element
name="product"> <xs:complexType> <xs:complexContent>
<xs:restriction base="xs:integer"> <xs:attribute
name="prodid" type="xs:positiveInteger"/>
</xs:restriction> </xs:complexContent> </xs:complexType>
</xs:element>
• <xs:element
name="product"> <xs:complexType> <xs:attribute
name="prodid" type="xs:positiveInteger"/>
</xs:complexType> </xs:element>
• <xs:element
name="product"/> <xs:complexType> <xs:attribute
name="prodid" type="xs:positiveInteger"/>
</xs:complexType>
• <xs:element
name="product"/> <xs:complexType> <xs:sequence>
<xs:element name="prodname" type="xs:string"/>
</xs:sequence> </xs:complexType>
4. Which of the following is the
correct format for specifying the date in UTC?
Answers:
•
<start>09-24-2009Z</start>
•
<start>2002-09-24Z</start>
•
<start>2002-09-24</start>
•
<start>09-24-2009</start>
5. Which of the following validation
rules must be true of an element information item E to be locally valid(Simple
Type) with respect to an element declaration D?
Answers:
•
D{abstract}=false
•
D{nillable}=true
• If E has an
xsi:nil=true.
• D is not absent
and E and D have the same expanded name.
6. The elements of an XML schema
containing only text and attributes are declared using the________ element.
Answers:
•
<xs:contentType>
•
<xs:simpleContent>
•
<xs:complexContent>
• <xs:type>
7. Analyze the following example:
<xs:element
name="password">
<xs:simpleType>
<xs:restriction
base="xs:string">
<xs:pattern value="[a-zA-Z]{4}"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
Which of the following are acceptable
values for the password element in the above defined XML schema?
Answers:
• ab12
• abcd4
• xyZ4
• abc
8. Which of the following statements
is true about an XML representation of Attribute declarations in an XML schema?
Answers:
• If the
targetNamespace attribute is present, the name attribute should be present.
• If the
targetNamespace attribute is present, the form attribute should be present.
• If an item's
parent is not <schema>, both ref and name must be present.
• If both fixed
and use are present, use must have the optional value as prohibited.
9. Which of the following constraints
can be used by a boolean data type?
Answers:
• enumeration
• pattern
• minInclusive
• length
10. Which of the following whiteSpace
constraint values makes an XML processor reduce multiple spaces into a single
space?
Answers:
• preserve
• replace
• collapse
• remove
11. Which of the following
restrictions cannot be used with the ENTITIES String data type?
Answers:
• length
• enumeration
• pattern
• whiteSpace
12. Which of the following are primary
schema components?
Answers:
• Attribute
declarations
• Assertions
• Particles
• Complex type
definitions
13. Which of the following attributes
is used to specify that a schema attribute is required?
Answers:
• variable
• fixed
• use
• default
14. Analyze the following example:
<xs:element
name="letter">
<xs:simpleType>
<xs:restriction
base="xs:string">
<xs:pattern value="([a-z])*"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
Which of the following are acceptable
values for letter?
Answers:
• ab123
• Abcd
• abcd
• ABCD
15. Which of the following are
declaration components in an XML schema?
Answers:
• Element
• Datatype
• Model
• Notation
16. Which of the following elements
can only be included in the <annotation> element in an XML schema?
Answers:
• <appInfo>
• <notation>
•
<documentation>
• <choice>
17. Which of the following elements is
used to allow documents to contain additional elements that are not declared in
the main XML schema?
Answers:
• <any>
• <all>
• <choice>
•
<sequence>
18. In which of the following model groups
of an XML schema do the element information items match one or more of the
particles?
Answers:
• Sequence
• Disjunction
• Conjunction
19. Which of the following data types
are derived from the decimal data type?
Answers:
• float
• int
• int32
• double
20. Which of the following attributes
is defined inside the <xs:extension> element of an XML schema?
Answers:
• value
• type
• name
• base
21. Which of the following is a
secondary schema component?
Answers:
• Attribute
declarations
• Assertions
• Annotations
• Particles
22. Analyze the following schema file
"family.xsd":
<?xml version="1.0"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element
name="persons">
<xs:complexType>
<xs:sequence>
<xs:element name="person" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="full_name" type="xs:string"/>
<xs:element name="child_name" type="xs:string"
maxOccurs="5"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Which of the following statements are
true about the above schema file?
Answers:
• Each person
element must contain a full_name element.
• Each persons
element must contain a full_name element.
• Each person
element can contain a maximum of 5 child_name elements.
• The persons
root element can contain an unlimited number of persons element.
23. Suppose you want to limit the
content of an XML element called "car" to a set of acceptable values
like BMW, Audi etc. Which of the following constraints will you use in the
above situation?
Answers:
• enumeration
• pattern
• length
• fractionDigits
24. Analyze the following XML schema
fragment:
<xs:element name="name"
type="xs:string" block="substitution"/>
<xs:element name="navn"
substitutionGroup="name"/>
<xs:complexType
name="custinfo">
<xs:sequence>
<xs:element
ref="name"/>
</xs:sequence>
</xs:complexType>
<xs:element
name="customer" type="custinfo"
block="substitution"/>
<xs:element name="kunde"
substitutionGroup="customer"/>
Which of the following is a valid XML
document according to the schema above?
Answers:
•
<customer> <name>John Smith</name> </customer>
• <navn>
<kunde>John Smith</kunde> </navn>
•
<customer> <navn>John Smith</navn> </customer>
• <kunde>
<name>John Smith</name> </kunde>
25. Which of the following
restrictions can be used with the date data types?
Answers:
• enumeration
• fractionDigits
• totalDigits
• pattern
26. Which of the following type
definitions forms the root of the Type Definition Hierarchy?
Answers:
• xs:error
• xs:anyType
• xs:nil
• xs:location
27. Which of the following attributes
must be set to true to enable character data to appear between the
child-elements of an element in an XML schema?
Answers:
• mixed
• type
• base
• value
28. Which of the following is the
correct format for specifying the time interval using the XSD duration data
type?
Answers:
• PYnMnDnTHnMnSn
• PMnDnYnTHnMnSn
• PnMnDnYTnHnMnS
• PnYnMnDTnHnMnS
29. Which of the following statements
is true if default and use both are present in an XML representation of an
Attribute declaration?
Answers:
• The actual
value of use must be prohibited.
• The actual
value of use must be optional.
• The actual
value of use must be required.
• The actual
value of use must be default.
30. Which of the following are
built-in data types of an XML schema?
Answers:
• xs:string
• xs:number
• xs:boolean
• xs:float
• xs:date
31. Analyze the following XML document
having a reference to an XML schema:
<?xml version="1.0"?>
<note
xmlns="http://www.expertrating.com"
xsi:schemaLocation="http://www.expertrating.com note.xsd">
<to>Tove</to>
<body>Don't forget me this
weekend!</body>
</note>
Which of the following statements is
true?
Answers:
• The value
assigned to the schemaLocation attribute is in the wrong format.
• The XML Schema
Instance Namespace is not specified.
• A <head>
tag must be present.
• There is no
problem with this XML document.
32. Analyze the following schema
declaration:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.expertrating.com"
xmlns="http://www.expertrating.com"
elementFormDefault="qualified">
...
...
</xs:schema>
Which of the following fragments of
the schema declaration defines the namespace being used by the elements and
data types in the schema?
Answers:
•
xmlns:xs="http://www.w3.org/2001/XMLSchema"
•
targetNamespace="http://www.expertrating.com"
•
xmlns="http://www.expertrating.com"
•
elementFormDefault="qualified"
33. Which of the following is the
correct syntax for defining restrictions on an XML element value in an XML
schema?
Answers:
•
<xs:restriction type="xs:integer">
•
<xs:restriction value="xs:integer">
•
<xs:restriction base="xs:integer">
•
<xs:restriction data="xs:integer">
34. Which of the following are binary
data types in an XML schema?
Answers:
• binary
• hexBinary
• base32Binary
• base64Binary
35. Which of the following is the
correct format for specifying the date in an XML schema?
Answers:
• YYYY-MM-DD
• DD-MM-YYYY
• DD-MM-YY
• MM-DD-YYYY
36. What value of <maxOccurs>
indicator can you set when using the <all> indicator in an XML schema?
Answers:
• 0
• 1
• unbound
• No limit
37. Which of the following elements is
used to add multiple schemas with the same target namespace to a document?
Answers:
•
<annotation>
• <import>
•
<extension>
• <include>
38. Following is an example of an
element in an XML document using a time declaration in its schema definition:
<start>03:05:10.5</start>
Which of the following does the
component 10.5 specify?
Answers:
• Hours
• Minutes
• Seconds
39. Which of the following attributes
can be specified in the <xs:complexType> element of an XML schema so as
to allow several elements to refer to the same complex type?
Answers:
• type
• value
• name
• base
40. Which of the following is used to
replace spaces in a URI while using anyURI data type in an XML schema?
Answers:
•
"%20%"
• %20%
• %20
• 20%
41. Which of the following data types
are derived from the String data type?
Answers:
• boolean
• ID
• NCname
• anyURI
• Qname
42. The maximum number of decimal
digits that you can specify using the decimal data type in an XML schema is
________.
Answers:
• 10
• 15
• 16
• 18
• 20
43. Analyze the following schema
declaration:
<?xml version="1.0"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.expertrating.com"
xmlns="http://www.expertrating.com"
elementFormDefault="qualified">
...
...
</xs:schema>
Which of the following fragments of
the schema declaration indicates the default namespace of the XML schema?
Answers:
•
xmlns:xs="http://www.w3.org/2001/XMLSchema"
•
targetNamespace="http://www.expertrating.com"
•
xmlns="http://www.expertrating.com"
•
elementFormDefault="qualified"
44. What is the default value of the
<minOccurs> indicator for Order and Group indicators?
Answers:
• No default
value
• 0
• 1
• unbound
45. Which of the following is a helper
schema component?
Answers:
• Notation declarations
• Simple type
definitions
• Type
alternatives
• Wildcards