SetText get toString. Now, inside our block, we get our and loop until the end of the document
Now, inside our block, we get our and loop until the end of the document. If the current event is and the name of the element is , then we get the one‑and‑only attribute and pop that into our list of items for the selection widget. Since we’re in complete control over the XML file, it is safe enough to assume there is exactly one attribute. But, if you were not as comfortable that the XML is properly defined, you might consider checking the attribute count and the name of the attribute () before blindly assuming the 0‑index attribute is what you think it is.
As you can see in Figure 19‑4, the result looks the same as before, albeit with a different name in the title bar.
Figure 19‑4. The XMLResourceDemo sample application
Дата добавления: 2015-05-16; просмотров: 747;