About global resources
An Altova global resource file maps an alias to multiple resources via different configurations, as shown in the diagram below. An alias can therefore be switched to access a different resource by switching its configuration.
Global resources are defined in Altova products, such as Altova XMLSpy, and are saved in a global resources XML file. RaptorXML is able to use global resources as inputs. To do this, it requires the name and location of the global resources file, and the alias and configuration to be used.
The advantage of using global resources is that the resource can be changed merely by switching the name of the configuration. When using RaptorXML, this means that by providing a different value of the --globalresourcesconfig | --gc option, a different resource can be used. (See the example below.)
Using global resources with RaptorXML
To specify a global resource as an input for a RaptorXML command, the following parameters are required:
•The global resources XML file (specified on the CLI with the option --globalresourcesfile | --gr)
•The required configuration (specified on the CLI with the option --globalresourcesconfig | --gc)
•The alias. This can be specified directly on the CLI where a file name is required, or it can be at a location inside an XML file where RaptorXML looks for a filename (such as in an xsi:schemaLocation attribute).
For example, if you wish to transform input.xml with transform.xslt to output.html, this would typically be achieved on the CLI with the following command that uses filenames:
raptorxmlxbrl xslt --input=input.xml --output=output.html transform.xslt
If, however, you have a global resource definition that matches the alias MyInput to the file resource FirstInput.xml via a configuration called FirstConfig, then you could use the alias MyInput on the CLI as follows:
raptorxmlxbrl xslt --input=altova://file_resource/MyInput --gr=C:\MyGlobalResources.xml --gc=FirstConfig --output=Output.html transform.xslt
Now, if you have another file resource, say SecondInput.xml, that is matched to the alias MyInput via a configuration called SecondConfig, then this resource can be used by changing only the --gc option of the previous command:
raptorxmlxbrl xslt --input=altova://file_resource/MyInput --gr=C:\MyGlobalResources.xml --gc=SecondConfig --output=Output.html transform.xslt
|Note:||In the example above a file resource was used; a file resource must be prefixed with altova://file_resource/. You can also use global resources that are folders. To identify a folder resource, use: altova://folder_resource/AliasName. Note that, on the CLI, you can also use folder resources as part of a filepath. For example: altova://folder_resource/AliasName/input.xml.|