Know what is XSLT transformation in FrameMaker.
FrameMaker provides options for processing XML. FrameMaker also allows XML import and export to support XSL transformations, and the Schema language for grammar and rule definition (see XML with schema). You can import an XML document that uses schema, automatically creating a Document Type Definition (DTD) from the referenced schema, or you can create an Element Definition Document (EDD) directly from a schema definition. You can also validate against an associated schema upon both import and export.
XSL (EXtensible Stylesheet Language) is a style sheet language for XML documents. XSLT (Extensible Stylesheet Language Transformation) is the means by which transformations defined in XSL are applied to XML documents.
A language for transforming XML documents.
A language for navigating in XML documents.
A language for formatting XML documents.
FrameMaker includes an XSLT processor that allows you to associate an XSLT file with an XML structure application or XML document, and apply the transformations defined in that document when importing from or exporting to XML. FrameMaker supports W3C XSLT 3.0 recommendations. You can change the XSLT processor by editing the maker.ini file or from within your structured application.
New elements (SmartPaste
, PreProcessing
, PostProcessing
) in the structure application (XSLTPreferences
in the Stylesheets
element of XMLApplication
) allow you to specify an XSLT file as part of your XML structure application, to be used for both import and export.
The xml-stylesheet
processing instruction (PI) now allows you to specify an XSL file in an XML markup document, which supersedes any XSLT specified in the structure application when importing that document.
Upon import, XSL transformations are applied before the default read rules or any additional read rules you have defined. That is, the result of applying an XSL transformation on import is a new file, which (if it is an XML file) is passed to the read/write rules.
Upon export, XSL transformations are applied after the default or explicit write rules. The result of applying read/write rules on export is a new XML file, which, if it is valid, is passed to the XSLT processor.
You can create a hypertext output (XML or HTML) from an XML file using an XSL. You can create and save reusable transformations in an XML file. The reusable transformations include information such as the name and path of the XSLT and the path of the input and output files.
The output is created using a parser installed on the machine and registered with FrameMaker through maker.ini settings. XALAN and SAXON are installed by default on your machine with FrameMaker. XALAN supports XSLT 1.0 and SAXON supports XSLT 3.0. Both XALAN and SAXON are JAXP compliant.
SAXON is the default parser used when XSL is run directly or no transformation-specific parser is specified. However, you can specify a new default processor in the maker.ini file using the following flags:
[XSLTProcessors]
; processorName=jar path(all dependent jars should be in same dir), TransformerFactory class,
; default if default processor
; (if not specified - 1st processor would become default.)
XALAN=fminit\XSLT\XSLTProcessors\xalan\xalan-j_2_7_2-bin\xalan.jar,
org.apache.xalan.processor.TransformerFactoryImpl
SAXON=fminit\XSLT\XSLTProcessors\saxon\SaxonEE9-8-0-7J\saxon9ee.jar,
net.sf.saxon.TransformerFactoryImpl, Default
An XSL transformation includes information such as XSL, Parser, and Output folder, to create an output from XML files. The transformation that you create are stored in an XML file. There are two types of transformations: default and application-specific. The default transformations are stored in the file as specified in the maker.ini file using the TransformationFilePath flag. The application-specific transformations are stored in an XML file that you specify for the structured application in the structapps.fm file.
The XSLT toolbar maintains a history of the transformations you use and lets you use Advanced Run feature to create output from multiple XML files. From the toolbar, you can also choose and run a transformation\XSL on the open file. For more information, see Transform multiple files using Advanced Run.
A. Click to select an XSL file B. Click to select a transformation C. Run the selected transformation or XSL D. Click to display the Advanced Run dialog
In the maker.in file, locate the XSLTProcessors
section.
The entry for the SAXON
processor has the suffix: Default
.
XALAN=fminit\XSLT\XSLTProcessors\xalan\xalan-j_2_7_2-bin\xalan.jar,
org.apache.xalan.processor.TransformerFactoryImpl
SAXON=fminit\XSLT\XSLTProcessors\saxon\SaxonEE9-8-0-7J\saxon9ee.jar,
net.sf.saxon.TransformerFactoryImpl, Default
Cut and paste to shift the suffix to the XALAN
processor’s entry as following:
XALAN=fminit\XSLT\XSLTProcessors\xalan\xalan-j_2_7_2-bin\xalan.jar,
org.apache.xalan.processor.TransformerFactoryImpl, Default
SAXON=fminit\XSLT\XSLTProcessors\saxon\SaxonEE9-8-0-7J\saxon9ee.jar,
net.sf.saxon.TransformerFactoryImpl
Learn to create XSLT transformations in FrameMaker.
Select
.In the Manage Transformations dialog:
To use the default transformation file, select Default Transformation File and then click New.
To create a new transformation file, select Transformation File, click New.
Click New.
In the New Transformation dialog, specify the following information and click Save As to create a transformation file:
Transformation Name: A name for the transformation setting.
Use: Either select an XSL file or choose to use the processing instructions (PI) inside the XML file.
Processor: SAXON, XALAN, or any other parser registered with FrameMaker.
Output: Settings related to the output file, such as location to save, suffix, and how to open the output file.
Learn how to associate the transformation files to your XML application in FrameMaker.
Once you have created a transformation, you can associate the transformation file to one or more XML applications in structapps.fm.
In the WYSIWYG view, select
.In a structured application, locate the <TransformationFile>
element and specify the path and name of the transformations file.
Save the StructApps.fm file and select .
Now, you can choose to generate file output with the relevant application transformation.
See how you can work with Application-specific transformations in FrameMaker.
With an XML file in focus in XML View, in the XSLT toolbar select Transformation from the Choose drop-down.
In the Choose Transformations dialog, select Structured Applications.
The relevant application, as specified in structapps.fm, is selected from the drop-down list and the relevant transformations appear in the Transformations field.
In Transformations, select the transformation using which you want to generate the output and click OK.
In the XSLT toolbar, click Run.
FrameMaker generates the hypertext output and displays the file.
See how you can use advanced run to transformation on multiple XML files in FrameMaker.
Using the XSLT toolbar, you can run a transformation on multiple files.
In the Advanced Run dialog, select a scope for running the transformation:
Current File: Generate output from the XML file open in FrameMaker.
Select Include Child Elements if the active document is a book or a map. When this option is selected, the XSLT is applied to the child elements, together with the parent element.
All Open Files: Generate output from all the XML files open in FrameMaker using a transformation transformations or XSL.
Folder: Generate output from all the XML files in a folder using a transformation or XSL. Select Include Sub-Folders, if necessary.
Select a transformation or XSL and click Run.
The output files are launched in the associated application.