lxplain2xml — Convert a text file to XML by wrapping it in an element


lxplain2xml [ -xmlns[:prefix]=uri ...] [ -w wrapper-name ] [ -l line-wrapper-name ] [ -e encoding ] [ -n ]


lxplain2xml converts a text file to an XML file by wrapping it with an element, and optionally wrapping each line of the file. An trivial internal DTD subset is provided so that the file is valid.

-w wrapper-name

the name of the element used to wrap the file. The default is TEXT.

-l line-wrapper-name

the name of the element used to wrap each line. If this is not specified, lines are not wrapped.

-e encoding

the name of the text encoding. This will be used as the encoding in the XML declaration. If it is guess, the program will attempt to guess the encoding.


prevents lxplain2xml from adding any whitespace.


The detection algorithm is very simplistic. It is really only useful for distinguishing UTF-8 from ISO Latin-1.

The wrapper element names are used literally and no namespace declarations are added.

This command does not take an optional filename (it only reads from stdin) because of incompatibility with an earlier version. This will be changed sometime.