lxconvert, lxconvertn — Convert data between XML and other formats, using XSLT-style templates
lxconvert
-w
[
-v
] [
-p param value
...]
-q item-query
-s stylesheet
[
xml-file
]
lxconvert
-r
[
-v
] [
-p param value
...]
-q item-query
-s stylesheet
-x xml-file
[
text-file
]
lxconvert is program for converting data from and to XML
for use by non-XML programs. XSLT-style templates are used to specify the
conversion. The conversion direction is specified by the
-w
/-r
option.
-w
converts XML to text and writes
it to the non-XML program;
-r
reads
from the non-XML program and converts text to XML.
The xml-file argument may be a URI instead of a filenames.
If no xml-file argument is given in the -w
case,
or no text-file argument in the -r
case,
standard input is used.
verbose output; various warnings are given which would usually be considered unimportant. These are mostly cases where the XSLT spec allows for error recovery, such as multiple templates with equal priority.
assign a value to an XSLT parameter. Only string values are allowed.
an XPath query identifying the nodes in the document to be converted. This might for example select elements whose text values are words, which will be processed by a program that expects one word per line.
an XSLT stylesheet containing templates to be used in converting
between XML and text formats. Templates should be provided for
read
and write
modes, as described
below.
write data to a non-XML program. In this case, each node in the XML
input document that matches the item-query
has
templates applied to it, as if by
<xsl:apply-templates mode="write" select="
.
The template should extract the relevant text from
the node and output it in the format required by the non-XML program.
Output is in text mode by default.
item-query
"/>
read data from a non-XML program. In this case, each node in the XML
input document that matches the item-query
has
templates applied to it, as if by
<xsl:apply-templates mode="read" select="
.
The template should use the function
item-query
"/>
read-line()
(see below)
to receive a line of input from the non-XML
program, and use it to construct the new version of the node (for example,
by adding attributes to an element).