Sunteți pe pagina 1din 11

ACCP I10 SEMESTER 2

XML Simplified
MODULAR QUIZ
FOR
Module 7_8 More on XSLT. DOM and SAX.

Module 7 More on XSLT.

1..XPath provides multiple syntax that can be used for queries, addressing and patterns
True|False

2..XPath can be thought of as a query language like SQL.
True|False

3...In XPath, the structure of an XML document is viewed conceptually as a pyramid,
True|False

4...XPath provides a common syntax for features shared by XSLT and XQuery,
True|False

5...XPath is used to navigate through elements and attributes in an XML document
True|False

6...Can you match the XPath nodes againts their correspoding descriptions?

A..Text
B..Root
C...Namespace
D..Element
E...Attribute

a...Has a parent node and it may be the child node too
B...Contains all other nodes in the tree.
C...Is not considered a child of its parent node because they are not contained in a parent
node.
D...May have a unique identifier associated with them, which is useful when referencing
the node with XPath,
E...Has a parent node that is either an element or root node


7...Can you match the XPath nodes againts their correspoding descriptions?

A...Matching the root
B....Matching by name
C...Matching by ancestry
D...Matching by attribute
E...Matching the element names

A..<xsl:template match="/"> ...</xsl:template>
B..<xsl:template match="Greeting">
C...<xsl:template match="P//EM">
D...<xsl:template match="Product"> <xsl:apply-templates
select="@Unit"/></xsl:template>
E...<xsl:template match="Product"> <xsl:value-of select="Product_ID"/>
</xsl:template>


8...XSLT allows any kind of data to be transformed into a boolean value
True|False

9...A node-set is an unordered group of nodes from the input document.
True|False

10...A string is a sequence of zero or more Unicode characters,
True|False

11..The numbers like 43 or -7000 that look like integers are stored as float,
True|False

12...A string is a sequence of one or more Unicode characters
True|False

13...The local-name () function returns the name of the current node or the first node in
the specified node set - without the namespace prefix.
True|False

14..The floor (num) function returns the largest integer that is not greater than the number
argument.
True|False

15...The only allowed operation in a result tree fragment is on a number.
True|False

16...In a substring o function, the index of the first character is 0.
True|False

17...The translate () function returns the first argument string with occurrences of
characters in the second argument string replaced by the character at the corresponding
position in the third argument string.
True|False

18...An XSLT processor takes three things as input such as XSLT stylesheet, XML
document and Document Type Declaration.
True|False

19...The XSLT engine begins by reading in the XSLT stylesheet and caching it as a look-
up table.
True|False

20...For each node it processes, it will look in the table for the best matching rule to
apply.
True|False

21...Starting from the root node, the XSLT engine finds rules, executes them, and
continues until there are no more nodes in its context node set to work with,
True|False

22...XSLT can also be called as XSLT document or transformation script
True|False

Module 8 DOM and SAX.

1...Document Object Model treats a document as an object?
True/False

2...Document Object Model is platform-dependent?
True/False

3...Document Models can be hierarchical model, non-linear model or object model?
True/False

4...Document Object Model allows programmers to write different set of code for
interpreting document running on any platform?
True/False

5...Document Object Model allows programs and scripts to access and update content,
structure and style of documents in a standard way?
True/False

6...Linear Model is applied to dynamic document object?
True/False.

7...The hierarchical structure of the XML document is known as the XML Tree and it
consists of root, nodes and leaves?
True/False

8...Tree model is applied to static documents?
True/False

9...Object Model is a collection of objects for accessing and manipulating the XML data?
True/False

10...W3C DOM uses both tree and object model concepts?
True/False

11..XML parser is a software package, library or module that reads XML document?
True/False

12...Schema checks for the validity of the XML document?
True/False

13...DTD checks for the structure and content of the XML document?
True/False

14...Well-formedness of XML documents means that each starting tag has a matching
end tag?
True/False

15....XML parser can perform operations on input of any data type?
True/False

16...Can you match the different parsing events with their corresponding description?
A...Object-based.
B...StAX.
C...SAX.
D...DOM
E...Event-driven.

A..Performs object-based parsing
B..Uses pull model for event processing
C..Uses push parsing mechanism for event processing.
D..Builds the document as a in-memory data structures.
E..Read the XML document in a sequential order.

17...DOM parser is used for navigating the document recursively?
True/False

18...StAX parser has no built-in document navigation support.
True/False

19...SAX parser has high memory consumption.
True/False

20...StAX parser parses the XML document once.
True/False

21...DOM parser allows random access to document.
True/False

22...A node can have more than one parent nodes.
True/False

23...DOM is a W3C standard.
True/False

24...DOM considers all items present in XML document as node.
True/False

25...Leaf nodes have child nodes under them.
True/Fasle

26...Element node is the starting point of the DOM tree.
True/False

27...Document object is the only object that is created.
True/False

28...loadXML() method is used to load an XML file.
True/False

29...load() method is used to load a string.
True/False

30....new ActiveXObject(Microsoft.XMLDOM); creates an XML document object.
True/False

31...ownerDocument attribute associates a child node with the parent node.
True/False

32...Can you match the method names with their description?
A..Represents the attribute of an element.
B..Returns the name of the node present between the tags.
C..Accepts an integer as an argument.
D..Returns a node list of elements.
E..Returns the value associated with each node.

1..getElementByTagName()
2..text
3..NODE_ATRIBUTE
4..nodeName
5..item()
A-3, B-4, C-5, D-1, E-2
33...Can you match the different SAX handler with their description?
A...DefaultHandler.
B...XMLReader.
C...ContentHandler.
D...DefalutHandler.
E...ContentHandler.

A...Does not define any behavior of its own.
B...Sets and retrieves the feature and properties in the parser.
C...setContentHandler() method is used to register an instance with the SAX parser.
D...Implements the method of ErrorHandler, EntityResolver, DTDHandler.
E...Accesses the content of the XML document.


34...SAX is developed by XML-DEV mailing list.
True/False

35...SAX includes functions that are not supported by DOM.
True/False

36...SAX supports random access.
True/False

37...SAX requires the entire document to be stored in the memory.
True/False

38...SAX makes sequences of call to a handler function.
True/Fasle



Answer

II. Module 7 More on XSLT.

Question Answer
1 False
2 True
3 False
4 True
5 True
6 Text
Root
Namespace
Element
Attribute
7 Matching the root
Matching by name
Matching by ancestry
Matching by attribute
Matching the element
names
8 True
9 True
10 True
11 False
12 False
13 True
14 True
15 False
16 False
17 True
18 False
19 True
20 True
21 True
22 False


Module 8 DOM and SAX.

Question Answer
1 True
2 False
3 False
4 False
5 True
6 False
7 True
8 False
9 True
10 True
11 True
12 False
13 False
14 True
15 False
16 Object-based.
StAX.
SAX.
DOM
Event-driven.
17 True
18 True
19 False
20 False
21 True
22 False
23 True
24 True
25 False
26 False
27 True
28 False
29 False
30 True
31 True
32 A-3, B-4, C-5, D-1, E-2
33 DefaultHandler.
XMLReader.
ContentHandler.
DefalutHandler.
ContentHandler.
34 True
35 True
36 False
37 False
38 True