• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

More questions.

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:

a) Parse the input into a DOM tree and traverse the resulting tree.

b) Use SAX to extract the required elements.

c) Make use of an XSL style sheet.

d) Use the Scalable Vector Graphics (SVG) vocabulary.
I think SAX would be the right choice ie answer b)

2) A company wants to transmit parts of its sales order database to an outsourced service provider using XML. Which of the following is LEAST necessary?

a) Convert sales order database records into XML.

b) Validate the sales order XML before transmitting it to the service provider.

c) Use a DTD or XML Schema to describe the sales order data.

d) The service provider validates the XML sales order data after receiving it from the company

May be the correct answer is d).
Please Suggest.
Thanks,
Vasudha
 
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
b) Use SAX to extract the required elements.
c) Make use of an XSL style sheet.
>>>>I think SAX would be the right choice ie answer b)
I agree with you here. I guess the xsl stylesheet processor uses again builds the whole XML DOM tree in order to carry out the transformation. Someone please explain me the whole process flow of how the xslt processor works. I have some rough (mis??)conception of this given below -
XML Instance Document -> SAX processor builds ->
DOM tree -> walk thru the tree to extract the
required nodes

a) Convert sales order database records into XML.
b) Validate the sales order XML before transmitting it to the service provider.
c) Use a DTD or XML Schema to describe the sales order data.
d) The service provider validates the XML sales order data after receiving it from the company

>>>>May be the correct answer is d).
I think the choice boils down b/w (b) and (d). I guess the client(service provider) would always validate an xml document after receiving it to make sure that he got valid stuff. Hence my choice for this would be "b" (least necessary thing).
 
Jayadev Pulaparty
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A little addition.
2) A company wants to transmit parts of its sales order database to an outsourced service provider using XML. Which of the following is LEAST necessary?
I think if we look from the company's perspective (as in this question), "d" would be the least required thing. So you are absolutely right.
If we look at it from a neutral stand point, "b" would be the answer.
 
Vasudha Deepak
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the explanations.
Vasudha
 
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think answer for the first question is not b). The keywords here are "filter or extract a subset of information from the complete XML document"
SAX does not have the ability to do this. SAX will not have the complete XML document available for you to filter or extract.
The answer is between DOM and XSLT. I think XSLT is a better choice since many tools are ready to use in xslt. In DOM, you need to code yourself to do the filtering and extraction.
[ September 25, 2002: Message edited by: Roseanne Zhang ]
 
Jayadev Pulaparty
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think i should agree with Zhang. If we look carefully at the question (cleverly framed !!!)
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:
When i looked at the phrase "xml data set being very large", my sub-conscious took control and i started thinking about the memory consideration. But that is not mentioned here and i definitely feel that extracting the required info using SAX is pretty difficult when compared to any other approach.
I guess the approach of first applying a stylesheet (getting the required subset of info) and then parsing the result as a DOM is going to be more easy than trying to get the whole thing into a DOM (large document !!!) and then trying to parse it.
Hence i think the answer would be the XSLT approach.
 
Vasudha Deepak
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
PXML2 says that the 3 main reasons for choosing SAX should be,
1)Large Document Handling
2)Retreiving a specific value from a document
3)Creating a subset document.
Filters can be used in SAX, to remove unwanted elements,modify elements or attributes.
So I am wondering if the best choice would be SAX?Similar question #29 on http://viktor99.virtualave.net/IBM141a.html,says that an event driven processing model should be used for extracting required elements.

Thanks,
Vasudha
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
1. I think the correct answer is a) as the keywords are filter and extract so use DOM INstead of Sax
2. d) is the right choice
 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If we look at this line:

The BEST way to filter or extract a subset of information from the complete XML document


The words that tip me off are filter or extract..and..from the complete XML document.
It leads me to think it would be answer c). Why go with DOM or SAX when it can be done with XSL? I would have to agree with Roseanne.
 
Jayadev Pulaparty
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I too endorse this. SAX is the fastest way of walking down the tree, but definitely not the best way to "filter and extract" the required information. Had there been a mention of memory or speed concern, the answer would have been SAX. Also, there is no mention of changes to the content of the extracted info, which rules out the relevance of DOM. Hence we need only structural transformation of the input xml document and the easiest way to acheive this is using XSLT approach.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic