In certain circumstances it is necessary to add elements to an existing NIEM enumeration (or code list). In these situations one may choose to simply recreate a new list with all the same elements already defined in a NIEM code type and simply add those which do not yet exist. However, when the code list is larger than a few elements (such as a state code list with at least 50 valid values), using xsd:union as an option becomes more appealing.
The xsd:union provides a way to combine simple data types together to form a larger and more comprehensive data type. An example would be simply adding “ZZ” to a list of US Postal Service State (USPS) Codes to communicate an unknown or invalid state. This can be accomplished by extending the existing USPS code list in several steps.
Step 1 – Create a New Simple Type With New Values
Step 2 – Use xsd:union to Join the Values with Existing Values
Step 3 – Wrap the New Simple Data Type in a Complex Type
Step 4 – Create Element Instantiating the New Code List
Now any place an nc:LocationStateCode can be use, our extended code list can be used instead.
No comments:
Post a Comment