Understand XSLT transformations in Adobe 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. 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.
XSL is a set of the following three specifications:
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 Structured 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 Structured Application (XSLTPreferences
in the Stylesheets
element of XMLApplication
) allow you to specify an XSLT file as part of your XML Structured 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 Structured 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.
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.ini 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