
Q61
Q61 Which XPath expression retrieves all title elements inside bookstore?
bookstore/title
/bookstore/title
//bookstore/title
bookstore//title
Q62
Q62 Which XPath expression selects the price element of the second book in bookstore?
/bookstore/book[2]/price
//book[2]/price
/bookstore//price[2]
//bookstore/price[2]
Q63
Q63 What does the following XPath expression return:
//book[last()]?
The first book element
The last book element
All book elements
The parent of all book elements
Q64
Q64 Which XPath expression selects all book elements that have a price greater than 30?
//book[price>30]
//book[@price>30]
//book[price>="30"]
//book[price>'30']
Q65
Q65 Why does the following XPath expression cause an error?
/library/book[@id=001]
@id must be enclosed in quotes
XPath does not support attributes
The path should start with //
The id attribute must be numeric
Q66
Q66 An XPath query /bookstore/book/title returns an empty result. What is the likely cause?
The XML document does not contain books
The XPath query is incorrect
The XML structure does not match the query
The XPath query should use // instead of /
Q67
Q67 An XPath query //book[3]/title does not return a result, even though books exist. What is the problem?
The XML document has fewer than three books
The title elements are missing
The XPath query syntax is incorrect
The index should be 2 instead of 3
Q68
Q68 What is the purpose of XSLT?
To query XML data
To transform XML documents into other formats
To validate XML documents
To encrypt XML data
Q69
Q69 Which of the following best describes XSLT?
It is a scripting language
It is a declarative transformation language
It is a subset of Java
It is used to style XML
Q70
Q70 How does XSLT process an XML document?
Sequentially, like a script
Using pattern matching and templates
By compiling XML into binary
By executing JavaScript
Q71
Q71 What is an XSLT template?
A function that modifies XML
A set of rules applied to elements
A script that runs on the server
A schema for XML validation
Q72
Q72 Which of the following XSLT elements is used to iterate over XML nodes?
<xsl:apply-templates>
<xsl:for-each>
<xsl:if>
<xsl:choose>
Q73
Q73 Which XSLT element is used to apply a transformation rule?
<xsl:apply-templates>
<xsl:value-of>
<xsl:transform>
<xsl:attribute>
Q74
Q74 What does the <xsl:value-of select="name"/> statement do?
Sets a new XML value
Selects the text value of the name element
Deletes the name element
Applies a CSS style to name
Q75
Q75 How do you conditionally apply a transformation in XSLT?
Using <xsl:choose>
Using JavaScript
Using CSS styles
Using <xsl:apply-if>
Q76
Q76 What does the following XSLT code do?
<xsl:template match="book"><h2><xsl:value-of select="title"/></h2></xsl:template>
Deletes book elements
Replaces book elements with h2
Outputs the title inside an h2 tag
Ignores book elements
Q77
Q77 Why does an XSLT transformation fail when applied to an XML document?
The XML document is missing a DTD
The XML document is not well-formed
The XML document contains an inline schema
The XSLT file is too large
Q78
Q78 An XSLT transformation does not apply to some XML elements. What is the most likely cause?
The elements do not have matching templates
XSLT does not support transformation
The XML file is encrypted
XSLT is case-insensitive
Q79
Q79 Why would the following XSLT code not work?
<xsl:template match="title"><p><xsl:value-of select="." /></p></xsl:template>
title is not a valid XML element
The template should match //title instead
title is an attribute, not an element
XSLT does not support text nodes
Q80
Q80 What is XML parsing?
Converting XML to binary
Processing XML to extract data
Encrypting XML files
Compressing XML documents
Q81
Q81 Which of the following is a characteristic of DOM parsing?
Processes XML sequentially
Loads the entire XML document into memory
Cannot modify XML
Uses event-based processing
Q82
Q82 What is an advantage of SAX parsing over DOM parsing?
SAX parsing allows direct modification of XML
SAX is event-driven and uses less memory
SAX is faster for small files
SAX loads the entire XML document into memory
Q83
Q83 When should SAX parsing be preferred over DOM?
When memory consumption is a concern
When XML needs frequent modifications
When searching for a specific node
When working with small XML files
Q84
Q84 What is a drawback of SAX parsing?
It is slower than DOM
It does not support event handling
It cannot modify XML while parsing
It requires loading the entire document into memory
Q85
Q85 Which of the following correctly initializes an XML parser in Python using DOM?
xml.dom.parse("file.xml")
xml.sax.parse("file.xml")
xml.etree.ElementTree("file.xml")
xml.parser.load("file.xml")
Q86
Q86 In Java, which class is used to parse an XML file using DOM?
SAXParserFactory
DocumentBuilderFactory
JsonParser
XMLReader
Q87
Q87 Which of the following methods is used to register a handler in SAX parsing?
setHandler()
registerHandler()
setContentHandler()
setXMLHandler()
Q88
Q88 What is the output of the following Java SAX parser snippet?
startElement("bookstore", "book", "book", attributes)
The start of the XML document
The start of a book element
The end of the XML document
The end of a book element
Q89
Q89 Why does a DOM parser consume more memory than SAX?
It processes XML line by line
It loads the entire XML file into memory
It cannot handle large XML files
It requires a network connection
Q90
Q90 A SAX parser throws an error while processing an XML file. What is the likely cause?
The XML file is too small
The XML file has an invalid structure
SAX does not support XML parsing
The XML document is missing comments

