XCS to RNG Converter Online is a web-based tool to generate Relax NG schemas for validating TBX. A generated RNG will validate any XML file against TBX core structure and the XCS file/data provided.
The web front end is based on JSON Editor Online. All XCS data is dealt with in JSON; you may upload, download, view and edit XCS data using JSON viewer. Regular XML XCS files are converted into JSON and displayed.
Supported browsers: Chrome, Firefox, Safari, Opera, Internet Explorer 8+.
Below are links to sample files; each is a zipped archive containing an XCS file, the same XCS file converted into a JSON format, and the RNG file generated using the XCS 2 RNG tool.
The generated RNG does not check the XCS constraints on reference
objects (though it might in the future), nor does it check
forTermComp for any meta-data category besides
termNote; it is unclear to the author what the expected
behavior is in this case.
Also, the Relax NG specification does not include full validation of
IDREF values; RNG will check that a value is a well-formed
IDREF, but not that an element with the specified
id actually exists in the file.
Finally, the RNG generator does its best to match the behavior of the TBX Checker, but it differs in some ways. Both tools may, in some respects, be considered more thorough than the other at checking TBX. The missing functionality in TBX Checker is known to be rarely used, while the RNG generator cannot check IDREF validity or DTD adherence (other than core structure), quite commoly used features.
Should you choose to use the converter without the front-end, you are of course welcome to download the source or to use our API.
There are two scripts that you can post data to:
xcs2rng.php will convert the value of the posted
variable to RNG, or alternatively will convert the value of
json variable, which should be JSON-encoded XCS. The converted data is downloaded as a file if a
filename value is provided, otherwise only an id is returned. This id can be used to retrieve files from
xcs2json.php will convert the value of the
variable to JSON. Similarly to
xcs2rng.php, the data is returned as a file if a
filename value is provided, or is saved to the server and identified by an id, which is returned instead.
This tool uses JSON Editor Online, a web-based tool to view, edit, and format JSON. It shows your XCS data in a clear, editable treeview.
The application's main menu contains options to clear, load and save the JSON contents of the application. Files can be loaded and saved on disk, and loading from URL may be supported in the future. The data policy is described here.
Data can be loaded from either JSON or XCS files. XCS files are converted into JSON (via the gevterm server) before being displayed.
The "Load Dialect" option allows you to load XCS data for a particular, standardized dialect. Remember that the generated RNG schemas will check a TBX file against TBX core structure, not against the DTD normally used by a specific dialect (currently the only choice that doesn't use the core structure DTD is TBX-Basic).
The button sends the JSON data in the editor to the server, and then downloads an RNG file.
The input JSON data must have a correct structure to be usable by the RNG generation program. Every section of the data is required to be a certain type of data structure, and sometimes is required to contain certain data. Conversion errors are displayed in a red popup:
This message would be displayed if you changed the language specification to be an array instead of an object, as shown below.
The JSON Editor displays the JSON data in an editable tree. The editor makes it easy to create, duplicate and remove fields, and to edit the contents of the fields.
The menu of the editor contains the following functions:
The field values in the editor are editable input fields. The fields can be dragged up and down using the dragarea on the left side of the fields. When a field is the last item of the children of an array or object, the field can also be dragged horizontally to move it in or out of the array or object.
Right from the dragarea is a button to open the actions menu. Depending on the type of field, the following functionality is available in the actions menu:
The JSON Editor supports shortcut keys for all available actions. The editor can be used by just a keyboard. The following short cut keys are available:
|Alt+Arrows||Move the caret up/down/left/right between fields|
|Shift+Alt+Arrows||Move field up/down/left/right|
|Ctrl+Enter||Open link when on a field containing an url|
|Ctrl+Ins||Insert a new field with type auto|
|Ctrl+Shift+Ins||Append a new field with type auto|
|Ctrl+E||Expand or collapse field|
|Alt+End||Move the caret to the last field|
|F3, Ctrl+G||Find next|
|Shift+F3, Ctrl+Shift+G||Find previous|
|Alt+Home||Move the caret to the first field|
|Ctrl+M||Show actions menu|
|Ctrl+Z||Undo last action|