WITH COMPLETE SOLUTIONS VERIFIED
Which of the followings are valid for representing the expression: 0 < x < 10 in an
XML element? Select all that apply.
a) <form> 0 < x < 10 </form>
b) <form> 0 ⁢ x ⁢ 10 </form>
c) <form> 0 < x < 10 </form>
d) <form> 0 "<" x "<" 10 </form>
(b) and (c)
The purpose of using CDATA is to allow special characters to appear
in the element's text between the opening tag and closing tag.
Which of the following is an empty element in XML?
<image></image>
<image />
<image source = "Photo.jpeg" />
The attribute of an XML element can be placed
inside the opening tag of an XML element.
XML is often used for defining
data structures, communication protocols
,What design pattern in the javax.xml.parsers package allows the entire XML tree
to be read into memory?
DocumentBuilderFactory
To create an XML document using XmlTexWriter class, you need to open a file
stream and then create an XmlTexWriter object:
fS = new FileStream(fLocation, FileMode.CreateNew); XmlTextWriter writer = new
XmlTextWriter(fS, System.Text.Encoding.Unicode);
What operations need to be performed in order to properly close the files?
fS.Close(), writer.Close()
Answer the following questions.
(1) Will this piece of code create an in-memory tree to store the entire contents of
the XML file "Course.xml"? No(2) What line of code (see the numbers right to the
code) reads a new node into the memory? Line 3(3) What does the method
"reader.MoveToNextAttribute()" at line 7 return, if the node has no more attribute?
false
No, Line 3, false
A Document Type Definition (DTD) file
is used for defining the structure and syntax of a type of XML file.
What is the purpose of defining a default namespace in an XML file?
To reduce the use of a namespace qualifier prefixed to the element names
What type of file does the following piece of code most likely belong to?
<Book>
, <Title> </Title>
<Author> </Author>
</Book>
XML instance file
Google's Protocol Buffers are similar in syntax to
Class definition of an object-oriented programming language.
What is the capacity (expressivity) of XSL as a programming language? Select all
that apply.
It is able to express conditions using if-then-else constructs.
It is able to express loops.
It is Turing complete and thus is able to express general computing.
The Extensible Stylesheet Language XSL is used for defining the transformation
of an XML file to (Select all that apply)
an HTML file.
another XML file, with the same or a different structure.
Assume we have five (5) different Web data structures. We choose one structure
as the intermediate structure and we translate all other structures to and from
this structure. How many converters we need to have?
8 (We choose one from the 5 data structures. We design adapters to translate data from
the 4 structures and to the 4 structures. 4+4 = 8)
Assume we have five (5) different Web data structures, and we want to be able to
translate each structure directly to other four (4) structures. How many
converters we need to have?