1) In the XPath data model, a root node represents
_______________?
a) the document itself
b) all within the XML declaration
c) all the information within a particular namespace
d) the root element
2) What is not a valid XPath data model node?
a) Element
b) Root
c) Attribute
d) Text
e) Document type declaration
3) which of the following lines is the abbreviated syntax of
attribute::attributename?
a) %Cattributame
b) &attributename
c) @attributename
d) #attributename
4) Axes are used to _____.
a) evaluate conditions
b) generate output trees
c) navigate node trees
d) select nodelists
5) The bracket in the following is an example of _______.
//Section[@security="public"][@version="final"]
a) using expressions
b) using predicates
c) using nested properties
d) using funtions
6)The proper structure of Xpath expressions includes ______.
a) an axis, node test,optional function
b) an axis, node test, function
c) an axis, node test, optional predicate
d) an axis, node test, predicate
7) The input power to an XSLT processor is called the
_________.
a) input hierarchy
b) input transformation
c) input serialization
d) input tree
8) XSLT processor can retrieve data based upon which of the
following?
a) xsl:templates and match elements
b) xsl:templates elements and its match attribute
c) xsl:templates attribute and match element
d) xsl:templates and match attributes
9) Which statement best describes the benefit of using the
following code with SAX?
public class MyClass extends Default Handler
a) By extending the Default Handler we have access to all the
method defined in the SAX Interfaces
b) By extending the DefaultHandler we can implement all the methods
defined in the interfaces
c) By extending the DefaultHandler we have access to all the
methods defined in the ContentHandler interface.
d) By extending the DefaultHandler we can selectively choose which
methods defined in the interfaces to implement,
10) Which of the following statements does not offer a good reason to use SAX?
a) It's simple: you need to implement only three or perhaps four
interfaces to get going
b) The parser itself typically has a smaller footprint than that of
its DOM cousin. In fact, DOM implementations are often built on the
top of SAX
c) SAX programming requires fairly intricate state keeping
d) It's quick because it doesn't need to read in the whole document
before you start work on it
11) How many startDocument events and how many startElement
events will be fired when the following XML
SAX parser?
<a>
<b q='yyy'>zzz</b>
<c>nnn</c>
<d>ppp</d>
</a>
a) O startDocument events and 4 startElement events
b) O startDocment events and 3 startElement events
c) 1 startDocment events and 4 start Element events
d) 1 startDocment events and 3 startElement events
12) SAX was developed to work with data that is too large to
remain resident in memory
a) True
b) False
13) SVG output is bitmapped like JPEG and GIF
a) True
b) False
14) Which statement about SVG is not true?
a) SVG is an XML application.
b) SVG can be enlarged without pixelation.
c) SVG works very well with photographic images
d) SVG usually has a smaller file size
1) Option A - the document itself
Explanation: The XML document in XPath is always parsed/considered as a tree with 7 various nodes. Out of these 7 different nodes, one node is the root node which represents the document itself. However, the root node further has different children such as comments, processing instructions, root element, etc.
Other options are incorrect because they all are represented by other nodes and not the root node.
2) Option E - Document type declaration
Explanation: As already told in the above part's explanation, the XML document is parsed as a tree by the XPath model. This tree has the following 7 valid nodes:
Hence, it is clear from the above 7 nodes that document type declaration is not a valid node in XPath data model.
3) Option C - @attributename
Explanation: Any attribute in the XPath data model can be easily selected/retrieved and hence can be accessed by using @ followed by the attribute name of the element. Hence, it is written as @attributename. This is same and actually the abbreviation of the syntax:
attribute::attributename
which does the same job of selecting an element and accessing it.
4) Option D - select nodelists
Explanation: The Axes in XPath are basically used to define the relationship between the selected nodes and the current node. In simple words, axes are used to locate and select nodes relative to a current node in the tree. Note that nodes here refers to a nodelist which may contain multiple nodes. For example, an axis can be used to select nodes in the tree that are a child of a current node, ancestors of that node, nodes following a given node, descendant of a given node, etc. As we can see, all these are relationships of a given node with other nodes which are selected by using the axis. Hence, option D - select nodelists is the correct answer.
1) In the XPath data model, a root node represents _______________? a) the document itself b)...
Please answer for all the subparts, explaination is not necessary, only answers will suffice. 1) How many startDocument events and how many startElement events will be fired when the following XML SAX parser? <a> <b q='yyy'>zzz</b> <c>nnn</c> <d>ppp</d> </a> a) O startDocument events and 4 startElement events b) O startDocment events and 3 startElement events c) 1 startDocment events and 4 start Element events d) 1 startDocment events and 3 startElement events 2) The bracket in the following is an...
I am having trouble with these JDBC and XML questions. 1) The type of XML Parsing that parses an XML document based on expression and is used extensively in conjunction with XSLT. a) SAX Parsing b) DOM parsing c) StAX d) XPath Parsing 2) On the XML below, which XPath expression will return all of the values of title attributes? <slideshow title="Sample Slide Show" date="Date of publication" author="Yours Truly" > <!-- TITLE SLIDE --> <slide type="all"> <title>Wake up to WonderWidgets!</title>...
Download the library.xml file. The root
element is CATALOG and contains a series of BOOK
elements, each of which represents a single BOOK. Each
BOOK element has a number of child elements such as
AUTHOR, TITLE, GENRE, PRICE and so on.
Python Language 3.8
Add comments for each line
Thank you
Write a program to read the file and print out the following
information with an appropriate message:
1. (40 points) Write a function called
display_book that prints the title,...