Modifying the Data Type of a Node
It's possible to change the dataType property of a node during runtime. This is done by assigning the new type to the property. Once the new type is assigned, the allowable values that can be assigned to text will now match what that type allows. These simple modifications are the subject of the next example.
Listing 7.3 is an abbreviation of one used previously. It's also available on the companion Web site.
Listing 7.3 A Simple File to Be Used in Dynamically Modifying the Data Type
1: <?xml version="1.0"?> 2: <!--This file is a shortened version of the XML data file used to demonstrate the assignment of specific data types to data components. It is used as the source code for the exercise on modifying the ... |
Get Sams Teach Yourself XML in 24 Hours now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.