Apache::ASP Powered by ModPerl & Apache Powered by Apache::ASP
Demo ASP: xml_subs_strict.asp 2024-07-27

This is a demonstration of the XMLSubsMatch extension which allows for the developer to construct a set of custom XML style tags for use in ASP scripts. These tags could be used to render entire XML documents, or even simply give some nice short cuts for use when site building.

Further, the XMLSubsStrict setting has been set.

Currently, XMLSubsMatch is set to: [ my:\w+ ]

Whatever tags XMLSubsMatch matches of the form

 <matchtag param1="value1" param2="value2">
   text
 </matchtag>
  -- or --
 <matchtag param1="value1" param2="value2"/>
will be parsed into perl subroutines of matchtag name with arguments and text passed in, so these subs would be called respectively for the above XMLMatchSubs:
&matchtag( { param1 =>"value1", param2=>"value2" }, 'text' );
  -- and --
&matchtag( { param1 =>"value1", param2=>"value2" }, '');
Note that XMLSubs tags of the form foo:bar will be changed into a call to &foo::bar(), so that the XML concept of tag prefix namespaces is translated to the concept of perl packages.

Title Box

XML Subs Demo

The bgcolor=red param should have been skipped because it was not surrounded with quotes like bgcolor="red" or bgcolor='red'

Title Box
The color='red' param is OK here as it had the correct syntax.

The my::* perl subs defining the XMLSubs are located in the global.asa.

view this file's source