Results 1 to 4 of 4
  1. #1
    namlunxxx is offline Member
    Join Date
    Jun 2010
    Posts
    2
    Rep Power
    0

    Default Help me answer a few questions

    Exam (1) Integrating XML with Java

    Question 1
    Marks: 1

    When using the DOM API, how does a developer access attribute values?
    Choose at least one answer.


    a. call the getAttributes() method on Node and iterate over the NamedNodeMap

    b. call the getAttribute() method on Element

    c. call the getAllAttributes() method on Element and iterate over the NamedNodeMap

    d. call the getAttributeNode() method on Element and access the value property on Attr

    e. call the getAttribute() method on Node
    Question 2
    Marks: 1
    If two DOM nodes are equivalent, which of the following are TRUE?
    1. The DOM nodes have the same node type and node name.
    2. The node data are the same.
    3. The collection of attribute names are the same.
    Choose one answer.


    a. 1 and 3 only

    b. 2 and 3 only

    c. 1 and 2 only

    d. 1, 2 and 3
    Question 3
    Marks: 1
    For an application that makes use of XML, the input XML data set consists of many elements and is very large. The BEST way to filter or extract a subset of information from the complete XML document would be to:
    Choose one answer.


    a. Use SAX to extract the required elements.

    b. Use the Scalable Vector Graphics (SVG) vocabulary.

    c. Make use of an XSL style sheet.

    d. Parse the input into a DOM tree and traverse the resulting tree.
    Question 4
    Marks: 1
    Which of the following XPath function calls will return the value 10 when invoked ?

    Choose one answer.

    a. string-length("XML-Schema")

    b. count("XML-Schema")

    c. size("XML-Schema")

    d. length("XML-Schema")

    e. string("XML-Schema").size()
    Question 5
    Marks: 1
    Which of the following statements relating to cascading style sheets and formatting objects is FALSE ?

    (Select 2 correct choices)
    Choose at least one answer.


    a. It is possible to perform conditional formatting using XSL-FO, but not using CSS

    b. CSS is an XML syntax that can be used to describe the appearance of particular elements
    in an XML document

    c. fo:root is always the root element of a formatting objects document, assuming fo is mapped
    to the appropriate URI.

    d. Cascading style sheets can only be applied to non XML documents
    Question 6
    Marks: 1
    Which of the following statements are TRUE about error handling in SAX2?
    Choose at least one answer.


    a. Parsing continues after an error occurs.

    b. The ErrorHandler is registered with the ContentHandler via the setErrorHandler() method.

    c. Parsing errors are divided into two categories: errors and warnings.

    d. The default behaviors for warning() and error() callbacks is to do nothing.
    Question 7
    Marks: 1
    Which of the following statements about XSL formatting objects are true ?
    (Select 3 correct choices)
    Choose at least one answer.


    a. Formatting objects can be used to describe the layout of a rendered page

    b. It is possible to perform conditional formatting using XSL FO

    c. Elements in an XSL FO document describe the elements on a rendered page in a one to one fashion

    d. None of the options

    e. It is possible to render a page with multi column layouts using XSL FO
    Question 8
    Marks: 1
    What error types does the SAX2 ErrorHandler interface handle?
    Choose one answer.


    a. warning, error

    b. informational, warning, fatal-error

    c. warning, error, fatal-error

    d. informational, warning, error, fatal-error
    Question 9
    Marks: 1
    When you construct an XML using a DOM enabled Parser, the same parser should be used to process back
    the XML document when the process involves legacy applications, otherwise it is not necessary to do so.
    Choose one answer.


    a. You can use SAX enabled parser to fill this gap.

    b. Yes, whenver the process is between legacy conectivity this is better.

    c. This statement is not a correct one, because DOM is constructed using IDL

    d. Not really
    Question 10
    Marks: 1
    Which of the following statements about namespaces and DTDs are false?
    Choose one answer.


    a. A document can have a DTD but not use namespaces or use namespaces
    but not have a DTD

    b. Namespaces are completely independent of DTDs

    c. DTDs for a document with namespace qualified elements cannot be written
    since DTDs do not support namespaces

    d. A document can use both namespaces and DTDs or neither namespaces nor DTDs
    Question 11
    Marks: 1
    In DOM, the Document interface is the only interface that allows you to create other DOM document components.
    Choose one answer.


    a. true

    b. false
    Question 12
    Marks: 1
    Which of the following represents an abstraction of an unordered collection of nodes in DOM?
    Choose one answer.


    a. DocumentFragment

    b. Attributes

    c. NodeList

    d. NamedNodeMap
    Question 13
    Marks: 1
    Which interfaces are part of the SAX2 API?
    Choose one answer.


    a. DocumentHandler, Errorhandler, DTDHandler, SchemaHandler

    b. DocumentHandler, Errorhandler, DTDHandler, EntityResolver

    c. ContentHandler, ErrorHandler, DTDHandler, EntityResolver

    d. DocumentHandler, ErrorHandler, DTDHandler, EntityHandler
    Question 14
    Marks: 1
    A DOM-based parser should be used for which of the following situations?
    Choose at least one answer.


    a. Only need to process the XML document sequentially

    b. Need to have random access to the components of the XML document

    c. Performance and/or memory is an issue

    d. Need to modify the XML document directly
    Question 15
    Marks: 1
    XML document must have at least the document element (root).
    Choose one answer.


    a. false

    b. true
    Question 16
    Marks: 1
    Which of the following statements about XSL formatting objects are false ?
    Choose one answer.


    a. XSL-FO allows multi-column layouts and footnotes etc in page margins.

    b. Elements in XSL-FO objects map to the boxes on the page in a one to one fashion

    c. Formatting objects describes the layout of a series of nested boxes or areas that are placed on at least one page

    d. XSL-FO allows conditional formatting.
    Question 17
    Marks: 1
    Which of the following nodes in a DOM tree are always leaf nodes (nodes with no children)?
    (Select 3 correct choices)
    Choose at least one answer.


    a. Notation

    b. EntityReference

    c. Document

    d. CDATA Section

    e. Processing Instruction
    Question 18
    Marks: 1
    Which of the following unabbreviated XPath expressions is the same as the abbreviated
    XPath expression below?
    /book/chapter[4]/paragraph[2]/sentence[1]
    Choose one answer.


    a. /descendant-or-self::book/child::chapter[4]/child::paragraph[2]/child::sentence[1]

    b. /child::book/child::chapter[position()=4]/child::paragraph[position()=2]/child::sentence[position()=1]

    c. /descendant::book/child::chapter[4]/child::paragraph[2]/child::sentence[1]

    d. None of the options
    Question 19
    Marks: 1
    Which of the following lines can be used in an XML document named Test.xml
    to associate it with a stylesheet named Test.css
    Choose one answer.


    a. < ?xml-stylesheet href="Test.css" type="text/css"? >

    b. < ?xmlstylesheet href="Test.css" type="text/xsl"? >

    c. ?xml-stylesheet link="Test.css" type="text/css"?>

    d. < ?xml-stylesheet href="Test.xsl" type="text/css"? >

    e. < xml-stylesheet href="Test.css" type="text/css"/ >
    Question 20
    Marks: 1
    Which of the following XML based technologies can be considered as XML metadata?
    (Select 2 correct choices)
    Choose at least one answer.


    a. Document Object Model

    b. XML Schema

    c. eXtensible Stylesheet language

    d. Document Type Definition










    Exam (2) Integrating XML with Java
    Top of Form
    Question 1
    Marks: 1
    Which of the following SAX2 methods is used by a non validating parser to report that an entity reference
    is not resolved
    Choose one answer.

    a. ignorableWhitespace()
    b. skippedEntity()
    c. ignorableEntity()
    d. skippedEntityReference()
    Question 2
    Marks: 1
    Consider the following content models:

    < !ELEMENT doc (title?, chap*) >
    < !ELEMENT title (#PCDATA) >
    < !ELEMENT chap (sect+) >
    < !ELEMENT sect (para+) >
    < !ELEMENT para (#PCDATA) >

    Which of the following XML instances would be successfully validated against this DTD?
    Choose one answer
    .
    a. < doc >
    < chap >
    < para >Text< /para >
    < /chap >

    b. < doc >
    < title >Text< /title >
    < sect >
    < para >Text< /para >


    c. < doc >
    < chap >
    < sect >
    < para >Text< /para >


    d. < doc >
    < title >Text< /title >
    < /doc >
    Question 3
    Marks: 1
    An XML document to be processed is very large. The application extracts a small portion of the information from the document. Memory and speed may be constraints. Which method or methods are most appropriate for this situation?
    Choose one answer.

    a. Extract the necessary information and process using XSLT.
    b. Use DOM
    c. Use a schema-based approach.
    d. Use SAX
    Question 4
    Marks: 1
    Which interfaces are part of the SAX2 API?
    Choose one answer.

    a. ContentHandler, ErrorHandler, DTDHandler, EntityResolver
    b. DocumentHandler, Errorhandler, DTDHandler, EntityResolver
    c. DocumentHandler, ErrorHandler, DTDHandler, EntityHandler
    d. DocumentHandler, Errorhandler, DTDHandler, SchemaHandler
    Question 5
    Marks: 1
    In DOM, the Document interface is the only interface that allows you to create other DOM document components.
    Choose one answer.

    a. false
    b. true
    Question 6
    Marks: 1
    A small retailer maintains inventory data in an XML document. This inventory data is read by an application.
    The application allows new inventory items to be added to the XML based database. The application also allow
    update of inventory details in the XML based database.
    Which of the following XML technologies is MOST likely to be used by the application ?
    Choose one answer.

    a. XML schema validator
    b. DOM Parser
    c. SAX Parser
    d. XSLT processor
    e. XQuery
    Question 7
    Marks: 1
    Consider a system which is memory & speed constraint. The application is to process XML documents,
    sort the contents and mail them to a higher configuration machine for transformation. Which is the best approach?
    Choose one answer.

    a. Use platform native language to process the docuements
    b. Use DOM based approach.
    c. Using SAX based approach is the best.
    d. DOM and SAX must be used in this context.
    Question 8
    Marks: 1
    When using the DOM API, how does a developer access attribute values?
    Choose at least one answer.

    a. call the getAttributeNode() method on Element and access the value property on Attr
    b. call the getAttribute() method on Node
    c. call the getAllAttributes() method on Element and iterate over the NamedNodeMap
    d. call the getAttribute() method on Element
    e. call the getAttributes() method on Node and iterate over the NamedNodeMap
    Question 9
    Marks: 1
    Which of the following statements about namespaces and DTDs are false?
    Choose one answer.

    a. A document can have a DTD but not use namespaces or use namespaces
    but not have a DTD
    b. Namespaces are completely independent of DTDs
    c. A document can use both namespaces and DTDs or neither namespaces nor DTDs
    d. DTDs for a document with namespace qualified elements cannot be written
    since DTDs do not support namespaces
    Question 10
    Marks: 1
    When using a SAX2 parser, a developer wants to get called back by the parser when problems occur. Which of the following can be used to accomplish this goal?
    Choose at least one answer.

    a. Implement the DocumentHandler interface.
    b. Implement the ContentHandler interface.
    c. Subclass the DefaultHandler class and override methods for events of interest.
    d. Implement the ErrorHandler interface.
    Question 11
    Marks: 1
    Which of the following nodes in a DOM tree are always leaf nodes (nodes with no children)?
    (Select 3 correct choices)
    Choose at least one answer.

    a. Processing Instruction
    b. Notation
    c. EntityReference
    d. CDATA Section
    e. Document
    Question 12
    Marks: 1
    Which of the following axes can be used together to reference all the nodes in any XML document ?
    Choose one answer.

    a. ancestor-or-self,descendant-or-self,self
    b. ancestor, following-sibling, preceding-sibling, descendant
    c. It is not possible to reference all the nodes using unabbreviated
    XPath expressions
    d. ancestor, descendant, self, following, preceding
    e. ancestor, descendant, self, child
    Question 13
    Marks: 1
    When Processing Instructions are a part of your parsing process, DOM should be used,
    since SAX cannot be used to detect a Processing Instruction in a document.
    Choose one answer.

    a. true
    b. false
    Question 14
    Marks: 1
    Which is the best description of the "characters()" method?
    Choose one answer.

    a. a method of the DOM interface to replace the entity reference
    with the character data
    b. None of these.
    c. a method of the SAX ContentHandler interface to receive notification
    of the presence of character data
    d. a method of DOM API to insert character data in the XML document
    Question 15
    Marks: 1
    Which of the following unabbreviated XPath expressions is the same as the abbreviated
    XPath expression below?
    /book/chapter[4]/paragraph[2]/sentence[1]
    Choose one answer.

    a. /descendant::book/child::chapter[4]/child::paragraph[2]/child::sentence[1]
    b. /child::book/child::chapter[position()=4]/child::paragraph[position()=2]/child::sentence[position()=1]
    c. /descendant-or-self::book/child::chapter[4]/child::paragraph[2]/child::sentence[1]
    d. None of the options
    Question 16
    Marks: 1
    An empty file is a well-formed XML document
    Choose one answer.
    a. false
    b. true
    Question 17
    Marks: 1
    Which of the following represents an abstraction of an unordered collection of nodes in DOM?
    Choose one answer.

    a. NamedNodeMap
    b. DocumentFragment
    c. NodeList
    d. Attributes
    Question 18
    Marks: 1
    DOM can be used to process HTML documents.
    Choose one answer.

    a. true
    b. false
    Question 19
    Marks: 1
    To define an XML vocabulary, an XML developer could use:
    Choose at least one answer.

    a. XML Schema
    b. Namespaces
    c. DTDs
    d. XSLT
    e. UML
    Question 20
    Marks: 1
    Which of the following XML Schema element definitions are equivalent to the element definition below ?
    < xsd:element name="myElement" type="xsd:anyType" / >
    Choose one answer.

    a. None of the above
    b. < xsd:element name="myElement" type="xsd:string" / >
    c. < xsd:element name="myElement" / >
    d. < xsd:element name="myElement" type="ANY" / >
    e. < xsd:element name=myElement / >
    Thank so much
    Last edited by namlunxxx; 06-16-2010 at 04:44 PM.

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default

    What are your answers and why?
    This is not a homework service, but we'll be glad to correct your results.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    namlunxxx is offline Member
    Join Date
    Jun 2010
    Posts
    2
    Rep Power
    0

    Default

    Quote Originally Posted by PhHein View Post
    What are your answers and why?
    This is not a homework service, but we'll be glad to correct your results.
    Please !!!!! Help me ^:)^

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,173
    Rep Power
    20

    Default

    Which bit of "this is not a homework service" did you not understand?

    A quick scan of the quessies and reading the API would answer most if not all of them...and you are just as capable of that as we are.

Similar Threads

  1. Need help with Java Answer
    By alexisasoxfan in forum New To Java
    Replies: 2
    Last Post: 05-10-2010, 08:17 AM
  2. Need answer asap!!!
    By uranis_khai in forum New To Java
    Replies: 3
    Last Post: 07-07-2009, 10:48 AM
  3. Why is the answer not coming out
    By anonymous18 in forum New To Java
    Replies: 4
    Last Post: 11-12-2008, 04:10 AM
  4. Replies: 3
    Last Post: 11-02-2008, 02:29 AM
  5. Plz answer this question ...
    By raghu2114 in forum Advanced Java
    Replies: 2
    Last Post: 09-19-2008, 07:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •