Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xmlif(1) [redhat man page]

XMLIF(1)																  XMLIF(1)

NAME
xmlif - conditional processing instructions for XML SYNOPSIS
xmlif [attrib=value...] DESCRIPTION
xmlif filters XML according to conditionalizing markup. This can be useful for formatting one of several versions of an XML document depending on conditions passed to the command. Attribute/value pairs from the command line are matched against the attributes associated with certain processing instructions in the docu- ment. The instructions are <?if> and its inverse <?if not>, <?elif> and its inverse <?elif not>, <?else>, and <?fi>. Argument/value pairs given on the command line are checked against the value of corresponding attributes in the conditional processing instructions. An `attribute match' happens if an attribute occurs in both the command-line arguments and the tag, and the values match. An `attribute mismatch' happens if an attribute occurs in both the command-line arguments and the tag, but the values do not match. Spans between <?if> or <?elif> and the next conditional processing instruction at the same nesting level are passed through unaltered if there is at least one attribute match and no attribute mismatch; spans between <?if not> and <?elif not> and the next conditional process- ing instruction are passed otherwise. Spans between <?else> and the next conditional-processing tag are passed through only if no previous span at the same level has been passed through. <?if> and <?fi> (and their `not' variants) change the current nesting level; <?else> and <?elif> do not. All these processing instructions will be removed from the output produced. Aside from the conditionalization, all other input is passed through untouched; in particular, entity references are not resolved. Value matching is by string equality, except that "|" in an attribute value is interpreted as an alternation character. Thus, saying foo='red|blue' on the command line enables conditions red and blue. Saying color='black|white' in a tag matches command-line conditions color='black' and color='white'. Here is an example: Always issue this text. <?if condition='html'> Issue this text if 'condition=html' is given on the command line. <?elif condition='pdf|ps'> Issue this text if 'condition=pdf' or 'condition=ps' is given on the command line. <?else> Otherwise issue this text. <?fi> Always issue this text. FUTURE DIRECTIONS
The mark-up used by this tool is not set in stone, and may change in the near future. AUTHOR
Eric S. Raymond. Sep 26 2002 XMLIF(1)

Check Out this Related Man Page

SGMLPRE(1)						      General Commands Manual							SGMLPRE(1)

NAME
sgmlpre - handle SGML conditionalization for SGML-tools SYNOPSIS
sgmlpre [options] ... DESCRIPTION
This manual page documents briefly the sgmlpre commands. This manual page was written for the Debian GNU/Linux distribution because the original program does not have a manual page for sgmlpre. sgmlpre is a program that handle SGML conditionalization for SGML-tools It is used by other programs in sgml-tools (v1), and usually normal user does not need to use this program directly by himself. Following is quoted from the header in the source code. (Begin Quotes) sgmlpre -- handle SGML conditionalization for SGML-tools by Eric S. Raymond <esr@thyrsus.com>, 3 Nov 1997 Filter SGML according to conditionalizing markup. Argument/value pairs from the command line are matched against the attributes of <#if> and <#unless> tags. Spans between <#if>/</#if> are passed through unaltered if there is no attribute mismatch; spans between <#unless></#unless> are passed if there is at least one attribute mismatch. An attribute mismatch happens if an attribute occurs in both the command-line arguments and the tag, but the values do not match. Value matching is by string equality, except that "|" is interpreted as an alternation character. Even if a span is not passed through, its newlines are (this to avoid messing up the line numbers in error messages). This lexer requires flex. Limitations; attribute names may only be 256 chars long, values may be only 16384 (YY_BUF_SIZE) charac- ters long. Doesn't do checking that only </if> matches <if> and </unless> matches <unless> (that would need a stack and introduce another limit). (End Quotes) OPTIONS
The program does not support normal command line options. SEE ALSO
For a complete description, see the header in the source archive. AUTHOR
sgmlpre was written by Eric S. Raymond <esr@thyrsus.com>, 3 Nov 1997. This manual page was written by Taketoshi Sano <sano@debian.org>, for the Debian GNU/Linux system (but may be used by others). SGMLPRE(1)
Man Page