ArborX


txform

Longname: t x ml trans form   Open the Documentation Legend
Released: 7.08a 
Created: 7.08a 
Default value: n/a

Summary
This macro allows you to transform XML data to your requirements using XSLT.
Example extract

Below is a basic example of the syntax required to perform an XSLT transformation in Arbortext APP. First, the tag to be transformed is entered and the relevant number for the frequency of the transformation, in this case, zero stands for fully automatic. Next, the type of transformation is entered which is XSLT and then the source_tag is entered. Finally, a stylesheet is required in order to carry out the transformation.

 txform "destination_tag",0,4,"source_tag","stylesheet"

Syntax (7.08a)
tag name:s

Name of the target tag to overwrite. If the tag does not exist it will be created.

frequency:s

Enter the frequency of the transformation required.

Fully automatic. The transformation will always take place until it is disabled. You will not be able to edit the result stream. If you try to edit the result stream, you will be presented with the Attempted change to a transformed tag dialogue box. It is possible to overwrite the transformation you have set up by clicking the DisableTransform button. The results of the transformation are not saved with the .3d file. An empty tag exists with information telling 3B2 where and how the tag was generated so that it can be regenerated when required. This allows a smaller .3d file to be saved in contrast to the Fully automatic + save result in file option described below.
Fully automatic + save result in file. Ensures that the tags generated as a result of the transformation are saved with the .3d file. This creates a larger file than the Fully automatic option described above.
Manual updates only. Performs the transform just once, but saves the txform information with the generated tag.
One-off transform only. Creates a new tag and discards the transformation txform information with the generated tag.
type:n

Type of transformation.

None (disabled). Because transformation information is stored within a tag and that tag can be protected from updates, it is sometimes necessary to disable the transformation, for example, txform "result",0,0
Exact copy. Uses an exact copy of the source stream.
Translation map. Enables the user to use the smaps.3ad style character maps.
Search/replace miniscript. Enables a series of search and replace actions to be performed on the source stream.
XSLT transform. Enables you to apply an XSLT to the source stream.
Output XML tree - preserve whitespace - keeps the whitespaces present in the source stream.
Output XML tree - strip "default" whitespace. This option is the same as the 'Output XML tree - preserve whitespace' option above, but removes all white space between tags.
Version specific information8.11  SAX Parse XML stream.
Version specific information8.13o  Perl Script.
source tag:s

The name of the source tag for transform.

control tag:s

Optional control tag or stylesheet for transform. This is the name of the stream that contains the XSLT, translation map, search and replace script etc.

parameter control tag:s

Optional parameter control tag or stylesheet for transform. A parameter control tag can be used to pass external parameters to the stylesheet. When performing transformations, it is sometimes necessary to pass variable values from one template to another. This is particularly useful if you are using a named template to transform different XML trees. Similarly, it is also possible to modify the way a template behaves based on the value(s) set by an external parameter control stream. The parameter control stream can be of any type. The syntax for parameters in the control stream is: ParameterName="value" for example: Indent="Right"

Note that using parameter control tags is only available with the libxml parser. For more information on parsers in 3B2 see the XML in 3B2 chapter.

Perl Script transformations

This option calls a perl script to transform the input stream. The specified input, output and parameter streams are opened and close for use by the perl script by default.

The default names for the streams and associcated file handles are:

 open IN, "<$inputStream"; 1
 open OUT, ">$outputStream"; 2
 open PARAM, "<$paramStream"; 3

The code that gets run before the perl control script is located in string 1475, and the code that is run at the end is in string 1476.


Document created on 08-Feb-2003, last reviewed on 06-Sep-2005 (revision 1)