Xsltproc iso




















In most cases, applications know and trust the stylesheets they use. Some applications, though, may need to accommodate arbitrary stylesheets that expose them to the denial of service risk. XSL processing requests from anywhere on the web can then be sent to these installations thus shifting the risk to the party running the XSLTProc installation.

Obviously, a client application wouldn't want to invoke one XSLTProc installation after another until it found one willing to process some stylesheet. That compiler is generally available on all Linux distributions, and is also available for many Unix systems. It is even available for Cygwin a Linux environment that runs on Windows.

You might need to search the Internet to find one for your system if it does not already have one. To run the xsltproc processor, you need the libxml2 and libxslt packages, the ones with the highest version numbers. Then do the following:. You will need to have root permission to run the install step. If these steps proceed without error, you should be able to run this command to test it:. If you get a Command Not Found error message, then you need to find where xsltproc is installed and add that location to your PATH environment variable.

To use xsltproc, you specify the location of the main stylesheet file and your DocBook document, as well as any options and parameters:. You can place any options such as --output after xsltproc. You can use any number of --stringparam options to pass stylesheet parameter values on the command line, in this case setting the parameter named use.

If a parameter value includes spaces or special characters, put it in quotes. It is a graphical interface to xsltproc that lets you browse for filenames and set options and parameters. Currently Saxon is available in four packages:. It runs on any Java-capable system, and provides opportunities for adding extensions. It is probably the most commonly used Saxon package, and is the version used in the examples in this book.

The Instant Saxon processor is a precompiled version of Saxon 6. It is under active development, as are several of the standards that it implements. This is the commercial version of Saxon 8. That optional step is included here too. So your system must have a Java processing environment for it to work. Java version 1. You can find out which Java is on your system by executing java -version.

If you get Command not found then you may not have Java installed on the system, or it may not be in your PATH environment variable. Java version numbering has evolved over the years. The following table lists past and current Java versions:. The Java runtime system is available for download from Sun Microsystems, Inc.

If you have a different platform UNIX or Mac, for instance , then you need to contact your OS vendor to see if they make available an up-to-date Java runtime environment. Saxon is distributed as a zip file, so you need to unzip it into some suitable location. It can be a temporary location because you can move the few files you really need to a new location. To run Saxon, you only need to tell your Java processor where the Saxon. There are three files in the directory you unpacked Saxon into:.

You will not need saxon-fop. The DocBook stylesheets have some custom extension functions written specifically for the Saxon processor. These functions are contained in a saxon There may be several saxon jar files there, labeled by the version number of Saxon. Use the one closest to your Saxon version number. You want the Xerces2 Java parser. The web page has a link to where you can download just the latest jar file, xercesImpl. Put the file in a convenient location.

You need to include the full path to the necessary. That environment variable is used by the Java processor to locate compiled code used by Java programs. You can copy the. If it does not already exist in the list, then select New. Each path should be a full path to one of the required. For example:.

If you are already in a DOS window, you will need to exit and restart it for the new environment variable to take effect. This should report the version of Saxon that you have installed, as well as usage and command options. Saxon is a Java application that is executed from a command line. In order for the command to find all the Java code it needs, you must add the Java. Once you have done that, then you execute the java command as follows. The backslashes mean the line continues without break, but is shown here on separate lines for clarity.

Note that the XML document name precedes the stylesheet path in a Saxon command line. You can put any Saxon options such as -o before the document filename.

You can also set any number of stylesheet parameters such as use. See Chapter 6, Using stylesheet parameters for details on using parameters. The section on installing Saxon included an optional step for downloading the Xerces parser.

Once you have added the path to xercesImpl. These -D options must appear before the com. StyleSheet class name. The options will fail if the xercesImpl. Find centralized, trusted content and collaborate around the technologies you use most. Connect and share knowledge within a single location that is structured and easy to search.

If you want to write the output XML in a specific encoding you need to specify this on the xsl:output instruction. The big benefit of configuring the encoding this way rather than fixing it up later with iconv is that it means the XML serializer knows what the target encoding will be, and if your stylesheet tries to output any characters that are not representable in the selected character encoding then they will be preserved as character references rather than disappearing at iconv time, for example.

Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. How to output iso charset from xsltproc? Ask Question. Asked 7 years, 11 months ago. Active 7 years, 11 months ago.



0コメント

  • 1000 / 1000