@@ -14,41 +14,41 @@ XML::Axk::Core::L1 - ack-like XML processor, language 1
14
14
15
15
# PATTERNS AND ACTIONS
16
16
17
- ## ` on {<matcher>} run {<action>} [, <when>] `
17
+ - ` on {<matcher>} run {<action>} [, <when>] `
18
18
19
- Whenever ` <matcher> ` says that a node matches, run ` <action> ` .
20
- The optional ` <when> ` parameter says when in the course of processing to
21
- run ` <action> ` :
19
+ Whenever ` <matcher> ` says that a node matches, run ` <action> ` .
20
+ The optional ` <when> ` parameter says when in the course of processing to
21
+ run ` <action> ` :
22
22
23
- - ` HI `
23
+ - ` HI `
24
24
25
- When the node is first reached, before any of its children are processed
25
+ When the node is first reached, before any of its children are processed
26
26
27
- - ` BYE `
27
+ - ` BYE `
28
28
29
- After all of the node's children have been processed.
29
+ After all of the node's children have been processed.
30
30
31
- - ` CIAO `
31
+ - ` CIAO `
32
32
33
- Both ` HI ` and ` BYE ` . Suggestions for alternative terminology are welcome.
33
+ Both ` HI ` and ` BYE ` . Suggestions for alternative terminology are welcome.
34
34
35
- ## ` entering ` , ` whenever ` ` leaving `
35
+ - ` entering ` , ` whenever ` ` leaving `
36
36
37
- entering {<matcher>} run {<action>}
38
- whenever {<matcher>} run {<action>}
39
- leaving {<matcher>} run {<action>}
37
+ entering {<matcher>} run {<action>}
38
+ whenever {<matcher>} run {<action>}
39
+ leaving {<matcher>} run {<action>}
40
40
41
- The same as ` on {} run {} ` , with ` when ` set to ` HI ` , ` CIAO ` , or ` BYE `
42
- respectively.
41
+ The same as ` on {} run {} ` , with ` when ` set to ` HI ` , ` CIAO ` , or ` BYE `
42
+ respectively.
43
43
44
- ## ` perform { <action> } <matcher> [, <when>] `
44
+ - ` perform { <action> } <matcher> [, <when>] `
45
45
46
- If you prefer RPN, or you want to save some characters, you can put the
47
- ` <matcher> ` after the ` <action> ` using ` perform ` . For example,
48
- the following two lines have exactly the same effect:
46
+ If you prefer RPN, or you want to save some characters, you can put the
47
+ ` <matcher> ` after the ` <action> ` using ` perform ` . For example,
48
+ the following two lines have exactly the same effect:
49
49
50
- on { xpath(q<//item>) } run {say "$NOW: " . $E->getTagName}, CIAO
51
- perform {say "$NOW: " . $E->getTagName} xpath(q<//item>), CIAO
50
+ on { xpath(q<//item>) } run {say "$NOW: " . $E->getTagName}, CIAO
51
+ perform {say "$NOW: " . $E->getTagName} xpath(q<//item>), CIAO
52
52
53
53
# VARIABLES
54
54
@@ -67,41 +67,41 @@ that hold the state of the element being matched. This is similar to `$0`,
67
67
- ** $NOW**
68
68
69
69
The current phase, as a human-readable string: ` entering ` for ` HI ` ,
70
- ` leaving ` for ` BYE ` , and ` BOTH ` for ` CIAO ` .
70
+ ` leaving ` for ` BYE ` , and ` both ` for ` CIAO ` .
71
71
72
72
# MATCHERS
73
73
74
- ## ` xpath('xpath expression') `
74
+ - ` xpath('xpath expression') `
75
75
76
- Match nodes that match the given XPath expression. Remember that Perl will
77
- interpolate ` @name ` in double-quotes, so single-quote or ` q{} ` your XPath
78
- expressions.
76
+ Match nodes that match the given XPath expression. Remember that Perl will
77
+ interpolate ` @name ` in double-quotes, so single-quote or ` q{} ` your XPath
78
+ expressions.
79
79
80
- ## ` sel('selector') `
80
+ - ` sel('selector') `
81
81
82
- Match nodes that match the given selector.
82
+ Match nodes that match the given selector.
83
83
84
- ## ` always ` , ` never `
84
+ - ` always ` , ` never `
85
85
86
- Always or never match, respectively.
86
+ Always or never match, respectively.
87
87
88
88
# SPECIAL ACTIONS
89
89
90
- ## ` pre_all {<block>} `
90
+ - ` pre_all {<block>} `
91
91
92
- Run ` <block> ` before any file is processed.
92
+ Run ` <block> ` before any file is processed.
93
93
94
- ## ` pre_file {<block>} `
94
+ - ` pre_file {<block>} `
95
95
96
- Run ` <block>($filename) ` before each file is processed.
96
+ Run ` <block>($filename) ` before each file is processed.
97
97
98
- ## ` post_file {<block>} `
98
+ - ` post_file {<block>} `
99
99
100
- Run ` <block>($filename) ` after each file is processed.
100
+ Run ` <block>($filename) ` after each file is processed.
101
101
102
- ## ` post_all {<block>} `
102
+ - ` post_all {<block>} `
103
103
104
- Run ` <block> ` after all files have been processed.
104
+ Run ` <block> ` after all files have been processed.
105
105
106
106
# AUTHOR
107
107
0 commit comments