Gobo Eiffel XSLT Command-line usage and options |
![]() ![]() |
Gexslt is invoked from the command line. The general form is:
The stylesheet and source documents can be written either as URIs or as names in the local file system. Gexslt will attempt to convert a local file name into a URI, if it detects such a name is not already a URI.
If you want to use a file name that starts with --, or includes = as a character in the name, or might look to the system like a URI (e.g. if http://foo/bar is a valid file name on your system), then you can force gexslt to interpret it as a file name by writing it as --file=my/file.name.
If you want to ensure that gexslt treats a name as a URI (necessary if it starts with -- or includes =), then you can write it as --uri=my:strange=uri.
If the URI for a source document includes a fragment identifier, then gexslt will parse the document as normal, but will attempt to set the initial context node to be that specified by the fragment (according to the semantics for the particular media type). Note, that in this case, the initial context node will not necessarily match the pattern /, so the initial template may vary according to the fragment identifier. Note also, that the document root and document element are exactly the same nodes as they would be if no fragment identifier is supplied.
Gexslt recognizes the following media types:
This is treated according to the rules for application/xml, if no more specific rule is present.
If the resolver is unable to supply the media type, then application/xml is assumed, except for stylesheet modules, where application/xslt+xml is assumed (since the latter is defined to have identical fragment identifier semantics to the former, there is no significance to this difference).
Only shorthand pointers are supported for stylesheets. In this case, the shorthand pointer must point to an ID attribute (and the DTD must be available), or an xml:id attribute, on the xsl:transform or xsl:stylesheet element.
To set a global parameter on a stylesheet (as defined by a top-level xsl:param declaration), you may set it via an option. However, gexslt provides a more convenient syntax for the most common usage pattern, string-valued parameters:
Note that single quotes are only needed to avoid mis-interpretation by the command shell.
These string parameters may, in principle, appear anywhere within the command line, although it is conventional to put them at the end.
If you wish to pass general XPath expressions to the stylesheet, you have to use the --xpath-param option.
The following is a list of the options that can be given on the command-line:
The following options control stylesheet execution:
Gexslt has to parse the source document twice. Once to find the processing instruction, and again, after the stylesheet has been compiled (as it may contain xsl:preserve-space or xsl:strip-space commands). Although the first parse is quick (as the processing instruction must occur in the prolog of the XML document), this does mean that a stream that can only be read once may not be used with this option.
There are additional options that further control the interpretation of the xml-stylesheet processing instructions:
If this parameter is omitted (the usual situation), then the default mode is used.
If this parameter is omitted (the usual situation), then the initial template is the one that matches the document node of the source document. If this parameter is supplied, then the source document may be omitted.
You cannot use this option if you also supply the --template=<initial-template-name> option, and omit the source document, as then the XPath expression will have no context.
The following options control stylesheet execution tracing:
Set the destination for trace output to be "trace-file". If "trace-file" is omitted, then trace output is sent to the standard output stream.
If neither this option nor the timed-trace option is given, then no trace output is produced.
Set the destination for trace output to be "trace-file". If "trace-file" is omitted, then trace output is sent to the standard output stream.
The following options control issuing of error and warning messages:
If this parameter is not given, then warnings are sent to the standard error stream.
If this parameter is not given, then error messages are sent to the standard error stream.
Setting this value to a negative number means that all warning messages will be displayed. Setting it to zero means that no warning messages will ever be displayed.
The default is to take the appropriate recovery action and issue a diagnostic message.
The default is to take the appropriate recovery action and issue a diagnostic message.
Setting this value to a negative number means that all recoverable error messages will be displayed.
The following options control the use of OASIS ETRC XML catalogs
In this case, only catalogs specified in XM_CATALOG_FILES, plus any per-document-catalogs named in oasis-xml-catalog processing instructions, are searched.
In the latter case, when this option is given, PUBLIC entries are only considered for a match if they were defined when prefer="system" was in effect.
The default is to always consider PUBLIC ids, when no match is found for the SYSTEM id.
If no SYSTEM id is given, then this option has no effect.
The following options are available for performance tuning:
This seems to have a memory leak at the moment, so it is probably best to avoid using it.
The following options affect the mapping of URIs onto media-types, for interpretation of fragment identifies:
In the case of application/xhtml+xml, this will result in fragment identifiers being interpreted as the value of any ID-valued attribute.
For other XML media types, this will result in recoverable error XT1160, as RFC 2376 does not assign a meaning to the fragment identifier.
Without this option, it might be argued that gexslt is non-compliant. Apart from that, it doesn't serve any useful purpose.
The following options control the availability of extensions:
Copyright © 2004, Colin Adams and others mailto:colin@colina.demon.co.uk http://www.gobosoft.com Last Updated: Sunday, September 5th, 2004 |
![]() ![]() ![]() ![]() |