1XML::PatAct::Amsterdam(U3s)er Contributed Perl DocumentatXiMoLn::PatAct::Amsterdam(3)
2
3
4
6 XML::PatAct::Amsterdam - An action module for simplistic style-sheets
7
9 use XML::PatAct::Amsterdam;
10
11 my $patterns = [ PATTERN => { Before => 'before',
12 After => 'after' },
13 ... ];
14
15 my $matcher = XML::PatAct::Amsterdam->new( I<OPTIONS> );
16
18 XML::PatAct::Amsterdam is a PerlSAX handler for applying pattern-action
19 lists to XML parses or trees. XML::PatAct::Amsterdam applies a very
20 simple style sheet to an instance and outputs the result. Amsterdam
21 gets it's name from the Amsterdam SGML Parser (ASP) which inspired this
22 module.
23
24 CAUTION: Amsterdam is a very simple style module, you will run into
25 it's limitations quickly with even moderately complex XML instances, be
26 aware of and prepared to switch to more complete style modules.
27
28 New XML::PatAct::Amsterdam instances are creating by calling `new()'.
29 Parameters can be passed as a list of key, value pairs or a hash. A
30 Patterns and Matcher options are required. The following OPTIONS are
31 supported:
32
33 Patterns
34 The pattern-action list to apply. The list is an anonymous array
35 of pattern, action pairs. Each action in the list contains either
36 or both a Before and an After string to copy to the output before
37 and after processing an XML element. The Before and After strings
38 may contain attribute names enclosed in square brackets (`"["' NAME
39 `"]"'), these are replaced with the value of the attribute with
40 that name. The special NAME `"_element"' will be replaced with the
41 element's name.
42
43 Matcher
44 An instance of the pattern or query matching module.
45
46 Output
47 An IO::Handle or one of it's subclasses (such as IO::File), if this
48 parameter is not present and the AsString option is not used, the
49 module will write to standard output.
50
51 AsString
52 Return the generated output as a string from the `"parse()"' method
53 of the PerlSAX event generator.
54
56 Ken MacLeod, ken@bitsko.slc.ut.us
57
59 perl(1)
60
61 ``Using PatAct Modules'' and ``Creating PatAct Modules'' in libxml-
62 perl.
63
64
65
66perl v5.32.1 2021-01-27 XML::PatAct::Amsterdam(3)