Module:Format ISBN/data/doc

This module holds the data tables for formatting ISBNs. Tables are built by scripts, from XML data published by the International ISBN Agency, in the form of a range message. ISBN ranges are updated from time to time, and when that happens these data tables need to be refreshed.

There are two alternative ways to generate these tables: The results of both of these should be identical. Choose whichever is the most convenient.
 * Using a Python script, executed on a suitable local computer, or
 * A Lua module executed within the wiki framework

Invocation
Invoke the Python script shown below with: generate_isbn_data.py [file or url] >some_file.lua

The single argument is optional, either a local file containing the XML range message (or '-' for standard input), or the URL for the current range message resource. If not supplied, the script downloads data directly from the International ISBN Agency's web site.

Table updates
The script prints Lua table data to standard output. Capture this in a file, and then cut and paste it into Module:Format ISBN/data, replacing all existing content, to update the data tables to the latest version of ISBN range data.

If the editor's 'Show Changes' button indicates that the only difference is the MessageSerialNumber and MessageDate, then it is safe to abandon the change, since the data portion of the tables had not changed. Otherwise, save ('Publish') the updated content.

Invocation
Download the current ISBN rangemessage.xml file, and save it locally. Cut and paste the full text of this XML file into Module:Format ISBN/data/generator/xml. Use it to replace everything between the first and last lines of the existing content (that is, return |undefined and  |undefined), so that this module returns a Lua string.

If the editor's 'Show Changes' button indicates that the only difference is the MessageSerialNumber and MessageDate, then you can abandon the change, since the data portion of the tables had not changed. Otherwise, save ('Publish') the updated content.

Table updates
Assuming you did not abandon the update to Module:Format ISBN/data/generator/xml, go to Module talk:Format ISBN/data/generator to find the updated Lua tables. Cut and paste its contents into Module:Format ISBN/data, replacing all existing content, to update the data tables to the latest version of ISBN range data.