>Concorsi
>Forum
>Bandi/G.U.
 
 
 
 
  Login |  Registrati 
Elenco in ordine alfabetico delle domande di 70-315: Developing and implementing Web applications with Microsoft Visual C# .NET and Microsoft Visual Studio .NET

Seleziona l'iniziale:
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z  

> Clicca qui per scaricare l'elenco completo delle domande di questo argomento in formato Word!


Maytag buys and sells used refrigerators. External vendors frequently send you XML documents that list one type of used appliances for sale. The documents that you receive contain either only washers or only refrigerators as in the following example.

<!- A document with refrigerators --> < saleList> < refrigerators> < refrigerator type=¡± freezer on bottom¡± , price=¡± 210¡±/> < refrigerators> </ saleList> <!- A document with washers --> < saleList> < washers> < washer type=¡± front load¡± , price=¡± 145¡±/> < washer type=¡± top load¡± , price=¡± 130¡±/> </ washers> </ saleList>

All incoming XML documents are loaded into a MemorySystem object named usedList. You need to automate a process that will discover XML documents contain refrigerator elements. As soon as you ascertain that a document contains refrigerators, you can stop processing the document. You decide to use Visual studio . NET to develop an application that will contain a Boolean variable named hasRefrigerator. A value of True for this variable means that a document contains refrigerator elements. A value of false means that it does not. You want to ensure that the discovery process occurs as quickly as possible.

What should you do?   Create an XmlXPathDocument object and load it from usedList. Use an XPathNavigator object to search the XmlXPathDocument for the saleList/ refrigerators node. If this node is found, set hasRefrigerator to True. Otherwise, set hasRefrigerator to False.