xml <cars> <car><make>Cadillac</make><model>Escalade</model><year>2007</year></car> <car><make>Cadillac</make><model>Escalade</model><year>2011</year></car> <car><make>Ford</make><model>Mustang</model><year>1968</year></car> <car><make>Ford</make><model>Mustang</model><year>1998</year></car> <car><make>Mercedes</make><model>C-Class</model><year>1999</year></car> <car><make>Mercedes</make><model>C-Class</model><year>2009</year></car> </cars>
1.
`doc("cars.xml")/cars/car[year>2000].data`
2.
`doc("cars.xml")/cars/car[xs:integer(year) gt 2000]`
3.
`doc("cars.xml")/cars/car[year gt 2000]`
4.
`doc("cars.xml")/cars/car[integer(year) > 2000]`
Q 1 / 41
xml <xs:element name="car"> <xs:complexType> <xs:sequence> <xs:element name="make" type="xs:string"/> <xs:element name="model" type="xs:string"/> <xs:element name="year" type="xs:string"/> </xs:sequence> <xs:anyAttribute/> </xs:complexType> </xs:element> **Reference**: [XSD The `<anyAttribute>` Element](https://www.w3schools.com/xml/schema_complex_anyattribute.asp)
1.
The `<car>` element can be extended with only one attribute
2.
The `<car>` element can be extended with multiple attributes
3.
The `<car>` element cannot have any attributes
4.
The `<car>` element has child elements which can appear in any order
Q 2 / 41
xml <html xmlns="http://www.w3.org/1999/xhtml"> <head><title>XHTML Example</title></head> <body bgcolor="#FFFFFF" > <p>Content goes here ...</p> </body> </html> xml <html xmlns="http://www.w3.org/1999/xhtml"> <head><title>XHTML Example</title></head> <body name="bodySection"> <p><b>Content goes here ...</b></p> </body> </html> xml <html xmlns="http://www.w3.org/1999/xhtml"> <head><title>XHTML Example</title></head> <body color="#333333"> <p><i>Content goes here ...</i></p> </body> </html> xml <html xmlns="http://www.w3.org/1999/xhtml"> <head><title>XHTML Example</title></head> <body id="bodySelection"> <p><strong>Content goes here ...</strong></p> </body> </html>
1.
xml
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>XHTML Example</title></head>
<body bgcolor="#FFFFFF" >
<p>Content goes here ...</p>
</body>
</html>
2.
xml
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>XHTML Example</title></head>
<body name="bodySection">
<p><b>Content goes here ...</b></p>
</body>
</html>
3.
xml
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>XHTML Example</title></head>
<body color="#333333">
<p><i>Content goes here ...</i></p>
</body>
</html>
4.
xml
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>XHTML Example</title></head>
<body id="bodySelection">
<p><strong>Content goes here ...</strong></p>
</body>
</html>
Q 3 / 41
1.
XML, because it is extensible
2.
JSON, because it transfers data without waiting for a server response
3.
XML, because it supports namespaces
4.
JSON, because it is already parsed into a JavaScript object
Q 4 / 41
1.
PHP, .NET, and SQL
2.
HTML, CSS, and DOM
3.
Python, Perl, and C++
4.
Java, ASP, and C#
Q 5 / 41
xml <x/>
1.
null element
2.
self-closing tag
3.
improperly named element
4.
incorrect XML syntax
Q 6 / 41
**Explanation**: XML Attributes values [must be quoted](https://www.w3schools.com/xml/xml_attributes.asp). Element names are [case-sensitive](https://www.w3schools.com/xml/xml_elements.asp) (and CamelCase is actually one of the naming styles).
1.
XHTML attribute values must be quoted
2.
XHTML tags and attributes must be in lowercase
3.
XHTML elements must be properly nested within each other.
4.
XHTML tags must have an equivalent closing tag.
Q 7 / 41
1.
request-XML
2.
XMLHttpRequest
3.
ActiveXObject
4.
responseXML
Q 8 / 41
1.
processor; complies; process
2.
system; stores; retrieve
3.
non; processes; format
4.
human; annotates; manipulate
Q 9 / 41
xml <x a="x" a="y"></x>
1.
improperly named element
2.
self-closing tag
3.
null element
4.
incorrect XML syntax
Q 10 / 41
1.
It is mandatory to use closing tags with XML
2.
It is important for an XML document to be well formed
3.
XML elements start with an opening tag in angle brackets, such as `<p>`
4.
XML syntax uses tags, elements, and attributes
Q 11 / 41
1.
The last step is to complete the extension of XHTML compound documents and make sure the documents adhere to the defined namespaces.
2.
The last step is to create the DTD for the XHTML extension, which references both the XHTML modules and the new modules.
3.
The last step is to run the XHTML extension through the XSLT processor, which will properly format it.
4.
The last step is to verify that the XHTML is well formed and valid, and compatible with most browsers.
Q 12 / 41
1.
`#DEFAULT`
2.
`#OPTIONAL`
3.
`#IMPLIED`
4.
`#FIXED`
Q 13 / 41
1.
as a set of objects
2.
as a tree structure
3.
as an array of nodes
4.
as a dynamic program
Q 14 / 41
1.
Set the maxOccurs attribute to a large number, such as 1.000
2.
Set the maxOccurs attribute to 0
3.
Set the maxOccurs attribute to undefined.
4.
Set the maxOccurs attribute to unbounded.
Q 15 / 41
1.
`<xsl:apply-templates>` and `<xsl:call-template>`
2.
`<xsl:param>` and `<xsl:processing-instruction>`
3.
`<xsl:template>` and `<xsl:transform>`
4.
`<xsl:include>` and `<xsl:variable>`
Q 16 / 41
1.
Remove the prolog to make sure that the XML document will be properly processed across all platforms.
2.
Leave it alone, because the prolog does not require a closing tag.
3.
Move the prolog to an external file so that the XML document only has elements with closing tags.
4.
Add a closing tag, as al XML elements must have a closing tag.
Q 17 / 41
1.
XML is flexible and customizable.
2.
XML can be used to store data.
3.
XML is independent of Operating System.
4.
XML is a replacement for HTML.
Q 18 / 41
1.
ENTITIES
2.
IDREFS
3.
IDS
4.
IDSETS
Q 19 / 41
`This question is about understanding the XML аfile contents. XSD is the correct one here - that's the schema document, which describes the XML.`
1.
XSLT
2.
DOM
3.
AJAX
4.
XSD
Q 20 / 41
1.
`<!ATTLIST car color (red|white|blue|black) black>`
2.
`<!ATTLIST car color (red|white|blue|black) #REQUIRED>`
3.
`<!ATTLIST car color (red|white|blue|black) #FIXED>`
4.
`<!ATTLIST car color (red|white|blue|black)>`
Q 21 / 41
1.
CSS is a complete programming language with more powerful syntax.
2.
With CSS, the same element can be processed multiple times.
3.
CSS allows you to reformat data into completely new structures.
4.
CSS is easier to learn, use, and maintain.
Q 22 / 41
1.
Linked
2.
Internal
3.
External
4.
Structured
Q 23 / 41
1.
Header files, function declarations, global variables with their data types, and system library folder location.
2.
Namespace declaration, processor type, markup references, and encoding specification.
3.
The document's elements and attributes, their data types and default values, and the number and order of child elements.
4.
XML entity definitions, XSLT and cascading style sheets, DOM specification, and CDATA assignments.
Q 24 / 41
**Explanation**: [XHTML - Doctypes](https://www.tutorialspoint.com/xhtml/xhtml_doctypes.htm)
1.
Frameset
2.
Transitional
3.
Basic
4.
Strict
Q 25 / 41
xml <cars> <car> <make>Cadillac <model>Escalade</model> <price year="2007">$20,000</price> </make> </car> </cars>
1.
Cadillac
2.
Cadillac Escalade
3.
Cadillac Escalade 20000
4.
Cadillac Escalade $20,000
Q 26 / 41
xml <cars> <car><make>Cadillac</make> <model>Escalade</model> <year>2007</year></car> <car><make>Ford</make> <model>Mustang</model> <year>1968</year></car> <car><make>Mercedes</make> <model>C-Class</model> <year>1999</year></car> </cars> **Explanation**: [count()](https://developer.mozilla.org/en-US/docs/Web/XPath/Functions/count) returns the total the number of nodes (3), while [position()](https://developer.mozilla.org/en-US/docs/Web/XPath/Functions/position) returns the 0-based index of each node.
1.
`format-number()`
2.
`id()`
3.
`count()`
4.
`position()`
Q 27 / 41
xml <cars> <car><make>Cadillac</make> <model>Escalade</model ><year>2007</year></car> <car><make>Cadillac</make> <model>Escalade</model> <year>2011</year></car> <car><make>Ford</make> <model>Mustang</model> <year>1968</year></car> <car><make>Ford</make> <model>Mustang</model> <year>1998</year></car> <car><make>Mercedes</make> <model>C-Class</model> <year>1999</year></car> <car><make>Mercedes</make> <model>C-Class</model> <year>2009</year></car> </cars> xquery <ul> { for $x in doc("cars.xml")/cars/car where $x/year>2000 order by $x/year descending return <li>{$x}</li> } </ul> xquery <ol> { for $x in doc("cars.xml")/cars/car where $x/year>2000 order by $x/year desc return <li>{data($x)}</li> } </ol> xquery <ul> { for $x in doc("cars.xml")/cars/car where $x/year>2000 order by $x/year return <li>{$x}</li> } </ul> xquery <ol> { for $x in doc("cars.xml")/cars/car where $x/year>2000 order by $x/year descending return <li>{data($x)}</li> } </ol>
1.
A
2.
B
3.
C
4.
D
Q 28 / 41
1.
`4 (DONE)`
2.
`3 (LOADING)`
3.
`1 (PROCESSING)`
4.
`0 (UNSENT)`
Q 29 / 41
1.
Use the `<any>` element.
2.
Use the `<redefine>` element.
3.
Use `<xs:extension>`.
4.
Specify the new elements in the schema.
Q 30 / 41
xml <cars> <car><make>Cadillac</make><model>Escalade</model> <price year="2007">20000</price></car> <car><make>Ford</make><model>Mustang</model> <price year="2008">17000</price></car> <car><make>Mercedes</make><model>C-Class</model> <price year="2009">24000</price></car> </cars> NOTE: [XPather](http://xpather.com/) shows that all answers are incorrect. Report the question.
1.
`/car[price>20000]/make/model`
2.
`/car[price>=20000 and @year>=2009]/make/model`
3.
`//car[price>=20000 and @year>2008]/model`
4.
`/cars/car[price>=20000 and year>2008]/model`
Q 31 / 41
**Reference**: [XSD Attributres](https://www.w3schools.com/xml/schema_simple_attributes.asp)
1.
Set the type attribute to `xs:required`.
2.
Set the `use` attribute to `required`.
3.
Set the minLength attribute to 1.
4.
Set the minOccurs attribute to 1.
Q 32 / 41
xml <cars> <car><make>Cadillac</make><model>Escalade</model> <price year="2007">20000</price></car> <car><make>Ford</make><model>Mustang</model> <price year="2008">17000</price></car> <car><make>Mercedes</make><model>C-Class</model> <price year="2009">24000</price></car> </cars> **Explanation**: A trick question. The [`<xsl:sort>`](https://www.w3schools.com/xml/ref_xsl_el_sort.asp) will sort the output in ascending (alphabetical for strings) order by default. The `select` tells which tag to use for sorting.
1.
`<xsl:sort select="make" />`
2.
`<xsl:sort select="model" />`
3.
`<xsl:sort select="car" />`
4.
`<xsl:sort select="price" />`
5.
undefined
6.
undefined
7.
undefined
Q 33 / 41
1.
`/* */`
2.
`<!-- -->`
3.
`//`
4.
`(: :)`
Q 34 / 41
1.
Element
2.
Document
3.
EntityReference
4.
DocumentFragment
Q 35 / 41
1.
The implementation of an XHTML module requires an extension module and a validation module that ensures that the XHTML is well formed and valid; otherwise the extended instances aren't formally XHTML.
2.
The implementation of an XHTML module requires a definitions module and a constraint module that specifies syntax rules and uses the parameter entities declared in the definitions module.
3.
The implementation of an XHTML module requires a qualified name module and a declaration module that holds the element, element attribute, and content model declarations.
4.
The implementation of an XHTML module requires a namespace module that holds the element, element attribute, and content model declarations, and a parameter module that uses the entities declared in the namespace module.
Q 36 / 41
1.
`<xsl:namespace>`
2.
any valid element
3.
root element
4.
top-level element in the corresponding namespace
Q 37 / 41
1.
XML is too flexible and does not have enough reserved keywords.
2.
XML contains only data and not any processing instructions.
3.
XML does not perform any computation or algorithms.
4.
XML does not have specialized syntax rules.
Q 38 / 41
xml <cars> <car><make>Cadillac</make><model>Escalade</model><year>2007</year></car> <car><make>Cadillac</make><model>Escalade</model><year>2011</year></car> <car><make>Ford</make><model>Mustang</model><year>1968</year></car> <car><make>Ford</make><model>Mustang</model><year>1998</year></car> <car><make>Mercedes</make><model>C-Class</model><year>1999</year></car> <car><make>Mercedes</make><model>C-Class</model><year>2009</year></car> </cars>
1.
Elements `<make>` and `<model>` are ancestors of `<year>`.
2.
Elements `<make>` and `<model>` are children of `<cars>`.
3.
Elements `<make>` and `<model>` are siblings.
4.
Elements `<car>` and `<cars>` are parents of `<make>` and `<model>`.
Q 39 / 41
xml <cars> <car><make>Cadillac</make><model>Escalade</model><year>2007</year></car> <car><make>Ford</make><model>Mustang</model><year>1968</year></car> <car><make>Mercedes</make><model>C-Class</model><year>1999</year></car> </cars> css cars { display: block; } car(make), car(model), car(year) { display: inline; padding-top: 0.5em; } css car, cars { display: block; } make, model, year { display: inline; padding-top: 0.5em; } css cars { display: block; } car.make, car.model, car.year { display: inline; padding-top: 0.5em; } css cars { display: block; } car#make, car#model, car#year { display: inline; padding-top: 0.5em; }
1.
css
cars {
display: block;
}
car(make),
car(model),
car(year) {
display: inline;
padding-top: 0.5em;
}
2.
css
car,
cars {
display: block;
}
make,
model,
year {
display: inline;
padding-top: 0.5em;
}
3.
css
cars {
display: block;
}
car.make,
car.model,
car.year {
display: inline;
padding-top: 0.5em;
}
4.
css
cars {
display: block;
}
car#make,
car#model,
car#year {
display: inline;
padding-top: 0.5em;
}
Q 40 / 41
### Q42. Which element in this XML code is not a good candidate for conversion into an attribute? xml 1 <superheroes> 2 <name>Superman</name> 3 <alias>Clark Kent</alias> 4 <birthplace>Krypton</birthplace> 5 <power>Flight</power> 6 <power>X-Ray Vision</power> 7 <power>Super Strength</power> 8 </superheroes> ### Q43. What does the Document Type Definition (DTD) define?
1.
<make> is required, <model> is optional, <year> is optional, and <price> is optional.
2.
<make> is required, <model> is required, <year> is optional, and <price> is optional.
3.
<make> is required, <model> is required, <year> is required, and <price> is optional.
4.
<make> is required, <model> is optional, <year> is required, and <price> is optional.
5.
`<birthplace>`
6.
`<alias>`
7.
`<name>`
8.
`<роwer>`
9.
structure
10.
entities
11.
elements
12.
attributes
Q 41 / 41