17.05.2014 Views

PDFlib Text Extraction Toolkit (TET) Manual

PDFlib Text Extraction Toolkit (TET) Manual

PDFlib Text Extraction Toolkit (TET) Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Run the program as follows:<br />

nxslt3.exe FontReporter.tetml tetml2html.xsl -o FontReporter.html toc-generate=0<br />

XSLT within your own application. If you want to integrate XSLT processing in your<br />

application, the choice of XSLT processor obviously depends on your programming language<br />

and environment. The <strong>TET</strong> distribution contains sample code for various important<br />

environments. The runxslt samples demonstrate how to load a <strong>TET</strong>ML document,<br />

apply an XSLT stylesheet with parameters, and write the generated output to a file. If<br />

the programs are executed without any arguments they will exercise all XSLT samples<br />

supplied with the <strong>TET</strong> distribution. Alternatively, you can supply parameters for the<br />

<strong>TET</strong>ML input file name, XSLT stylesheet name, output file name and parameter/value<br />

pairs. You can use the runxslt samples as a starting point for integrating XSLT processing<br />

into your application:<br />

> Java developers can use the methods in the javax.xml.transform package. This is demonstrated<br />

in the runxslt.java sample. You can also execute Java-based XSLT in the ant<br />

build tool without any coding. The build.xml file in the <strong>TET</strong> distribution contains<br />

XSLT tasks for all samples.<br />

> .NET developers can use the methods in the System.Xml.Xsl.XslTransform namespace.<br />

This is demonstrated in the runxslt.ps1 PowerShell script. Similar code can be used<br />

with C# and other .NET languages.<br />

> All Windows-based programming languages which support COM automation can<br />

use the methods of the MSXML2.DOMDocument automation class supplied by the<br />

MSXML parser. This is demonstrated in the runxslt.vbs sample. Similar code can be<br />

used with other COM-enabled languages.<br />

XSLT extensions are available for many other modern programming languages as well,<br />

e.g. Perl.<br />

XSLT on the Web server. Since XML-to-HTML conversion is a common XSLT use case,<br />

XSLT stylesheets are often run on a Web server. Some important scenarios:<br />

> Windows-based Web servers with ASP or ASP.NET can make use of the COM or .NET<br />

interfaces mentioned above.<br />

> Java-based Web servers can make use of the javax.xml.transform package.<br />

> PHP-based Web servers can make use of the Sablotron processor, see www.php.net/<br />

manual/en/intro.xsl.php.<br />

XSLT in the Web browser. XSLT transformations are also supported by most modern<br />

browsers. In order to instruct the browser to apply an XSLT stylesheet to a <strong>TET</strong>ML document<br />

add a line with a suitable processing instruction after the first line of the <strong>TET</strong>ML<br />

document containing the xml processing instruction and before the root element. You<br />

can then load it in the browser which will apply the stylesheet and display the resulting<br />

output (note that Internet Explorer requires the file name suffix .xml when processing<br />

files from the local disk):<br />

<br />

<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!