Unix and Linux Discussions Tagged with text processing |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
10 |
3,157 |
Shell Programming and Scripting |
|
|
|
1 |
662 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
940 |
Shell Programming and Scripting |
|
|
|
8 |
2,080 |
UNIX for Advanced & Expert Users |
|
|
|
6 |
2,358 |
Shell Programming and Scripting |
|
|
|
1 |
1,577 |
Shell Programming and Scripting |
|
|
|
16 |
4,162 |
Shell Programming and Scripting |
|
|
|
8 |
2,516 |
Shell Programming and Scripting |
|
|
|
3 |
4,094 |
Shell Programming and Scripting |
|
|
|
2 |
1,783 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
1,538 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
2,557 |
Shell Programming and Scripting |
|
|
|
7 |
4,472 |
UNIX for Dummies Questions & Answers |
|
|
|
0 |
1,120 |
Programming |
|
|
|
7 |
2,397 |
Shell Programming and Scripting |
|
|
|
1 |
1,418 |
Programming |
|
|
|
3 |
1,588 |
Shell Programming and Scripting |
|
|
|
2 |
2,204 |
Shell Programming and Scripting |
|
|
|
4 |
2,714 |
Shell Programming and Scripting |
|
|
|
2 |
3,233 |
Shell Programming and Scripting |
|
|
|
8 |
4,705 |
Shell Programming and Scripting |
|
|
|
7 |
3,370 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
4,799 |
Homework & Coursework Questions |
|
|
|
6 |
3,106 |
Shell Programming and Scripting |
|
|
|
2 |
2,966 |
Shell Programming and Scripting |
|
|
|
15 |
100,880 |
Shell Programming and Scripting |
|
|
|
2 |
6,643 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
3,243 |
Shell Programming and Scripting |
|
|
|
3 |
1,683 |
Shell Programming and Scripting |
|
|
|
8 |
3,621 |
Shell Programming and Scripting |
XMLIF(1) xmlif 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
document. The instructions are <?xmlif if?> and its inverse <?xmlif if not?>, <?xmlif elif?> and its inverse <?xmlif elif not?>, <?xmlif
else?>, and <?xmlif 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 <?xmlif if?> or <?xmlif 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 <?xmlif if not?> and <?xmlif elif not?> and the
next conditional processing instruction are passed otherwise. Spans between <?xmlif else?> and the next conditional-processing tag are
passed through only if no previous span at the same level has been passed through. <?xmlif if?> and <?xmlif fi?> (and their `not'
variants) change the current nesting level; <?xmlif else?> and <?xmlif 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.
<?xmlif if condition='html'?>
Issue this text if 'condition=html' is given on the command line.
<?xmlif elif condition='pdf|ps'?>
Issue this text if 'condition=pdf' or 'condition=ps'
is given on the command line.
<?xmlif else?>
Otherwise issue this text.
<?xmlif fi?>
Always issue this text.
AUTHOR
Eric S. Raymond <esr@snark.thyrsus.com>
Author of xmlif program
Linux April 2009 XMLIF(1)