How XSL Formatter works

Download Report

Transcript How XSL Formatter works

How XSL Formatter works
Operation
System Requirements
How to format
GUI for operating on Windows screen
Application Integration Interface
Operation
We explain how to operate XSL Formatter for formatting XML. As a example
here, we show the way to output PDF by using XSL Formatter GUI interface.
1.Prepare XML contents. (Click the image to show the source.)
2.
Prepare XSLT stylesheet. (Click the image to show the source.)
3.
4.
In the XSL Formatter GUI, click File-Open menu. Then specify two files in the
Document/Stylesheet dialog.
Run formatter and the result will be shown in a screen. (Click the image to
show entire.)
5.
On the print menu, set printer name to Acrobat Distiller and click the print button.
6.
PDF file will be created
System Requirements
Item
Requirements
Operating system
Windows NT4.0/2000/XP/95/98/Me
NT4.0/2000/XP is recommended.
IE5.5 or later (both can be obtained free of
charge)
Printing function depends on Windows printer
driver.
Acrobat may be used to print PDF file.
Direct PDF creating engine is also available as
option from Antenna House, Inc.
XSLT processor
MSXML3.DLL
How to format
In the previous example, XSL Formatter processed XML file and
XSLT stylesheet, output the formatted result on the screen by
clicking Run Formatter. This process is divided into two steps
inside.
First step
XSL Formatter generates XSL Formatting Objects from
XML file and XSLT styleheet by launching XSLT processor.
Second step
XSL Formatter formats the file of XSL Formatting Object.
Formatting Objects
The contents of the file of XSL Formatting Objects generated in the first
step is shown below.(Click image to show the source.)
Formatting Objects is created by adding layout/ format specification to XML
contents. XSL Formatter formats as it is specified.
Changing stylesheet
We can get another formatted result from the same XML data by using
another stylesheet. Let's take an example of using another stylesheet.
1.
Prepare new XSLT stylesheet. Click the image to show the
source.)
2.
In this case, specify the same XML file and change only the file of
stylesheet. Click Run Formatter.(Here, the explanation of the Open
dialog is omitted.)
3.
Then the formatted results appear as follows. (Click the sales slip to
show entire)
We can get a quite different formatted result from the same source by changing
XSLT stylesheet.
Formatting engine and Interface
Formatting engine is at the core of Antenna House XSL
Formatter V2. We prepare three types of Interface
program to drive this formatting engine.
•Graphic User Interface (GUI) for using formatting engine
on standalone Windows PC.
•Interface for integrating user applications.
GUI for operating on Windows screen.
You can drive formatting engine interactively on the desktop by using GUI.
In other words, you can specify XML file and XSLT stylesheet file on PC Windows, run formatter, browse the
formatted result on your screen. If you are satisfied with the result, you can output to printer, convert to PDF
by specifying Acrobat driver.
In GUI, you can browse the formatted result by specifying URL of XML file and XSLT stylesheet,
downloading files from the Internet, formatting in your PC.
The URL of the source file explained in the beginning of this page is as follows. If XSL Formatter is installed
in your PC, you can format and display the formatted result in your PC by clicking the Open button on the File
menu, by specifying URL of the source, by running formatter.
Source XML file
http://www.antennahouse.com/axf20/spec-img/order.xml
The first XSLT stylesheet
http://www.antennahouse.com/axf20/spec-img/salesnote.xsl
Attention: This sample is only effective for XSL Formatter V2. If you use XSL Formatter V1.1E, this XSLT
stylesheet causes error. As XSL Formatter V1.1 conforms to XSL V1.0 Candidate Recommendation 21
November, 2000, some errors may occur by using the stylesheet based on XSL V1.0 W3C Recommendation.
The second XSLT stylesheet
http://www.antennahouse.com/axf20/specimg/shipping.xsl
Enter in the following way. Try at once.
Press the Run Formatter button.
Application Integration Interface
We provide COM Interface, Command-line Interface and JAVA Interface in
order to integrate the core formatting engine of XSL Formatter V2 into
your system easily.
By using COM Interface, you can easily make use of the function of XSL
Formatter from the languages that supports COM.
Example of using VBScript
sample.xml is formatted using sample.xsl. Then with Acrobat PDFWriter, the formatted result will be saved to sample.pdf.
dim objAXF
set objAXF=CreateObject("AXFOSVR.XFOObj")
objAXF.Source="C:\My Documents\XML\data\sample.xml"
objAXF.Stylesheet="C:\My Documents\XML\data\sample.xsl"
objAXF.Option="C:\My Documents\XML\data\option.ini "
objAXF.PrinterName="Acrobat PDFWriter"
objAXF.OutputFile=" C:\My Documents\XML\data\sample.pdf "
objAXF.Execute()
if Err.Number then MsgBox("Format Failed!", mbOKOnly)
set objAXF=nothing
Command-line is provided as an executable file. You can use formatting function by calling command-line from batch file or Windows
API ShellExecute.
Example of calling Command-line
sample.xml is formatted using sample.xsl. Then with PDF Writer, the formatted result will be saved to sample.pdf.
AXFOCMD -d "c:\My Documents\xml\sample.xml" -s "c:\My Documents\xml\sample.xsl" -i "c:\My Documents\xml\option.ini" -p
"Acrobat PDFWriter" -o "c:\My Documents\xml\sample.pdf"
Java Interface is newly added in V 2. The operating environment conforms to that of XSL Formatter.
Available in the following Java environment:
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
Java Interface is newly added in V 2. The operating environment conforms to that of
XSL Formatter.
Available in the following Java environment:
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
You can use the property, method equivalent of that shown in Integration Interface and
COM Interface in XSL Formatter Online Manual. Please refer to Help for more details.
COM Interface, Command-line Interface and JAVA Interface are supposed to output the
formatted results to printers, and cannot display the formatted results on screen. If you
need a function to integrate it into applications which enable to display the formatted
results on screen, contact us by e-mail.
Antenna House Computer Software, Inc.
Email: [email protected]
Copyright © 1996-2003 Antenna House, Inc. All rights reserved.