Unix and Linux Discussions Tagged with conditional |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
9 |
2,505 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
1,324 |
Shell Programming and Scripting |
|
|
|
5 |
2,011 |
Shell Programming and Scripting |
|
|
|
7 |
2,602 |
Shell Programming and Scripting |
|
|
|
2 |
1,657 |
Shell Programming and Scripting |
|
|
|
1 |
13,199 |
Shell Programming and Scripting |
|
|
|
9 |
3,570 |
Shell Programming and Scripting |
|
|
|
3 |
1,399 |
Shell Programming and Scripting |
|
|
|
3 |
2,747 |
AIX |
|
|
|
4 |
2,779 |
Shell Programming and Scripting |
|
|
|
9 |
4,325 |
Shell Programming and Scripting |
|
|
|
11 |
4,625 |
Shell Programming and Scripting |
|
|
|
10 |
3,671 |
Shell Programming and Scripting |
|
|
|
5 |
3,321 |
Shell Programming and Scripting |
|
|
|
5 |
3,252 |
Shell Programming and Scripting |
|
|
|
3 |
2,437 |
Shell Programming and Scripting |
|
|
|
4 |
4,171 |
Shell Programming and Scripting |
|
|
|
1 |
23,539 |
Shell Programming and Scripting |
|
|
|
3 |
3,373 |
Shell Programming and Scripting |
|
|
|
12 |
8,579 |
Shell Programming and Scripting |
|
|
|
1 |
6,958 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
2,766 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
2,295 |
Shell Programming and Scripting |
|
|
|
2 |
4,285 |
Shell Programming and Scripting |
|
|
|
1 |
5,614 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
17,921 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
3,721 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
4,127 |
UNIX for Dummies Questions & Answers |
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)