What event should you use?

You work as an application developer at Domain.com. You have just completed
the creation of an application that receives order data from Domain.com’s partner company in XML format.
The XML has to be utilized to create an Order object that is consumed by the new application.
The following exhibit displays an example of Domain.com’s partner company’s XML data:

Come to front door and ring door bell.
No other options.


536 Certkiller Lane
Miami
FL
70536

2006-07-12T00:00:00-04:00

Lounge Suite
1
200.00

Plasma Television
2
26.999.00

You plan to use the XmlSerializer class to deserialize the XML data into an Order object.
When you learn that Domain.com’s partner company’s XML also contains Shipping object data, you decide to deserialize the shipping object after the Shipping element is detected during deserialization.
To achieve this, you need to use a certain event of the XmlSerializer class.
What event should you use?

You work as an application developer at Domain.com. You have just completed

the creation of an application that receives order data from Domain.com’s partner company in XML format.
The XML has to be utilized to create an Order object that is consumed by the new application.
The following exhibit displays an example of Domain.com’s partner company’s XML data:

<?xml version=”1.0″ encoding=”utf-8″?>
<Order id=”101″>
<Shipping>
<Instructions>
Come to front door and ring door bell.
No other options.
</Instructions>
<Address>
<Street>536 Certkiller Lane</Street>
<City>Miami</City>
<State>FL</State>
<Zip>70536</Zip>
</Address>
</Shipping>
<Date>2006-07-12T00:00:00-04:00</Date>
<Details>
<SalesProduct InStock=”true” Taxable=”true”>
<Name>Lounge Suite</Name>
<Quantity>1</Quantity>
<Price>200.00</Price>
</SalesProduct>
<Product InStock=”false”>
<Name>Plasma Television</Name>
<Quantity>2</Quantity>
<Price>26.999.00</Price>
</Product>
</Details>
</Order>
You plan to use the XmlSerializer class to deserialize the XML data into an Order object.
When you learn that Domain.com’s partner company’s XML also contains Shipping object data, you decide to deserialize the shipping object after the Shipping element is detected during deserialization.
To achieve this, you need to use a certain event of the XmlSerializer class.
What event should you use?

A.
UnknownElement

B.
UnknownNode

C.
UnreferencedObject

D.
UnknownAttribute

Explanation:

The UnknownNode event is fired when an unexpected element or node is detected that does not map to the XmlSerializer object’s expected type. The UnknownNode event included the XmlNodeEventArgs, which allows access to the entire node of the XML data. This would allow easy deserialization for the Shipping object.

Incorrect Answers:
A, C, D: These options would not allow easy deserialization for the Shipping object.



Leave a Reply 1

Your email address will not be published. Required fields are marked *


seenagape

seenagape

I agree with the answer.