queries on xml

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dattathreya
    New Member
    • Sep 2008
    • 6

    #1

    queries on xml

    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
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    Do you post those questions just for fun or is there a problem anywhere behind? maybe except getting the right answers for a test, though in this case I ask you to conform to the Posting Guidelines

    Comment

    • jkmyoung
      Recognized Expert Top Contributor
      • Mar 2006
      • 2057

      #3
      Learn:



      Not sure what to include for the last question:
      http://java.sun.com/j2se/1.4.2/docs/.../dom/Node.html

      Comment

      Working...