Q1). <?xml version='1.0'?>
<book>
<title>XML for the Masses</title>
<author>Sue D. Nimm</author>
</book>
<book>
<title>Java United</title>
<author>Ike Odelotte</author>
</book>
Referring to the XML code above, if you are using DOM, what is the root node?
a) The XML processing instruction
b) Since the XML is not well-formed, there is no root.
c) The first book element
d) Both book elements
e) A document node that is a parent to the book elements.
Q2). What type of data can a SAX parser process?
a) RTF
b) HTML
c) XML
d) Arbitrary plain text
e) SGML
Q3). <message>
Good
<highlight>
day
</highlight>
earthling.
</message>
org.w3c.dom.Nod e message = rootnode.getFir stChild();
org.w3c.dom.Nod e earthling = message.getLast Child();
while (earthling != null)
{
System.out.prin tln(earthling.g etNodeValue());
earthling = earthling.getPr eviousSibling() ;
}
Referring to the XML data and DOM code above, where rootnode is a org.w3c.dom.Doc ument object, how many times is the print statement in the while loop executed?
a) Zero
b) One
c) Three
d) Five
e) Seven
<book>
<title>XML for the Masses</title>
<author>Sue D. Nimm</author>
</book>
<book>
<title>Java United</title>
<author>Ike Odelotte</author>
</book>
Referring to the XML code above, if you are using DOM, what is the root node?
a) The XML processing instruction
b) Since the XML is not well-formed, there is no root.
c) The first book element
d) Both book elements
e) A document node that is a parent to the book elements.
Q2). What type of data can a SAX parser process?
a) RTF
b) HTML
c) XML
d) Arbitrary plain text
e) SGML
Q3). <message>
Good
<highlight>
day
</highlight>
earthling.
</message>
org.w3c.dom.Nod e message = rootnode.getFir stChild();
org.w3c.dom.Nod e earthling = message.getLast Child();
while (earthling != null)
{
System.out.prin tln(earthling.g etNodeValue());
earthling = earthling.getPr eviousSibling() ;
}
Referring to the XML data and DOM code above, where rootnode is a org.w3c.dom.Doc ument object, how many times is the print statement in the while loop executed?
a) Zero
b) One
c) Three
d) Five
e) Seven
Comment