XML::Pa...sterdam(3)

πŸ’… NAME πŸ’…

okay so this is XML::Pa...sterdam(3) β€” User Contributed Perl Documentation β€” and the module itself is XML::PatAct::Amsterdam, an action module for simplistic style-sheets. ✨


🌸 SYNOPSIS 🌸

use XML::PatAct::Amsterdam;

my $patterns = [ PATTERN => { Before => 'before',
                              After => 'after' },
                 ... ];

my $matcher = XML::PatAct::Amsterdam->new( I<OPTIONS> );

πŸ¦‹ DESCRIPTION πŸ¦‹

XML::PatAct::Amsterdam is a PerlSAX handler for applying pattern-action lists to XML parses or trees. It applies a very simple style sheet to an instance and outputs the result. Amsterdam gets its name from the Amsterdam SGML Parser (ASP), which inspired this module. πŸ’–

⚠️ CAUTION: Amsterdam is a very simple style module β€” you will run into its limitations quickly with even moderately complex XML instances. Be aware of that and be prepared to switch to more complete style modules. πŸ’€

New XML::PatAct::Amsterdam instances get created by calling new(). Parameters can be passed as a list of key, value pairs or a hash. The Patterns and Matcher options are required. The following OPTIONS are supported:

  • Patterns β€” the pattern-action list to apply. The list is an anonymous array of pattern, action pairs. Each action in the list contains either or both a Before and an After string to copy to the output before and after processing an XML element. The Before and After strings may contain attribute names enclosed in square brackets ("[" NAME "]"), and these are replaced with the value of the attribute with that name. The special NAME "_element" will be replaced with the element’s name. πŸŽ€
  • Matcher β€” an instance of the pattern or query matching module. 🧚
  • Output β€” an IO::Handle or one of its subclasses (such as IO::File). If this parameter is not present and the AsString option is not used, the module will write to standard output. πŸ’…
  • AsString β€” return the generated output as a string from the parse() method of the PerlSAX event generator. πŸ¦‹

πŸ‘‘ AUTHOR πŸ‘‘

Ken MacLeod, ken@bitsko.slc.ut.us 🌟


🌈 SEE ALSO 🌈

  • perl(1)
  • β€œUsing PatAct Modules” and β€œCreating PatAct Modules” in libxml-perl. πŸ’œ

okay that’s the whole page bestie πŸ’– β€” it’s from perl v5.42.0, dated 2024-03-04, and the header title is XML::Pa...sterdam(3) ✨ periodt.

πŸ“¦ where this page comes from