xml-highlight(1) xml-utils xml-highlight(1) NAME xml-highlight - Highlight syntax in XML documents SYNOPSIS xml-highlight [options] [...] DESCRIPTION The xml-highlight tool adds syntax highlighting to program listings in an XML document. By default this is accomplished by wrapping detected syntax in XSL-FO inline elements with the proper namespace to allow a stylesheet to pass them through to the final FO processor. The actual elements used can be customized, however. To enable highlighting on text in an element, include the processing instruction in the element, where ... is the name of the language. OPTIONS -c, --classes Use a custom class definitions file. -f, --overwrite Overwrite input XML file(s) instead of outputting to stdout. -h, -?, --help Show help/usage message. -s, --syntax Use a custom syntax definitions file. --version Show version information. In addition, the following options allow configuration of the XML pars‐ er: --dtdload Load the external DTD. --huge Remove any internal arbitrary parser limits. --net Allow network access to load external DTD and entities. --noent Resolve entities. --xinclude Do XInclude processing. --xml-catalog Use an XML catalog when resolving entities. Multiple catalogs may be loaded by specifying this option multiple times. CLASS FILE FORMAT The following describes the format of the custom class file specified with -c. Classes Markup element: Attributes: · None Child elements: · Class Represents a type of syntax and how it should be highlighted. This el‐ ement can also occur within the syntax element or within a particular language element, in which case it is specific to that language. Markup element: Attributes: · id, the identifier of the class. Child elements: The element class contains one child element of any kind, which any matching syntax will be wrapped in to. Example custom classes file SYNTAX FILE FORMAT The following describes the format of the custom syntax file specified with -s. Syntax Markup element: Attributes: · None Child elements: · class · language Language Describes the syntax of a particular language. Markup element: Attributes: · name, the identifier of the language. · caseInsensitive, indicates whether keywords are case-insensitive in this language, with one of the following values: · "no" - Keywords are case-sensitive (default) · "yes" - Keywords are case-insensitive Child elements: · · · Area Matches a section of delimited text, such as strings, comments, etc. Markup element: Attributes: · start, the opening delimiter. · end, the closing delimiter. · class, reference to the class element to use for this area. Child elements: If attribute class is not used, this element can contain one element of any kind, in which the text matching the area will be wrapped. Keyword Matches a particular keyword. Markup element: Attributes: · match, the keyword to match. · class, reference to the class element to use for this keyword. Child elements: If attribute class is not used, this element can contain one element of any kind, in which the text matching the keyword will be wrapped. Example custom syntax file BUILT-IN LANGUAGES The following is a list of language syntaxes currently built-in to the tool: · c · csharp · go · java · javascript · pascal · python · ruby · rust · sh · sql · xml · xsl AUTHORS khzae.net. 2020-07-07 xml-highlight(1)