Apache-ASP

 view release on metacpan or  search on metacpan

site/eg/xml_subs.asp  view on Meta::CPAN

  <%=$Server->Config('XMLSubsMatch')%> 
  <% $Response->Write(']'); %>
</my:ttb>
<p>
Whatever tags XMLSubsMatch matches of the form
<pre><%=
$Server->HTMLEncode('
 <matchtag param1="value1" param2="value2">
   text
 </matchtag>
  -- or --
 <matchtag param1="value1" param2="value2"/>
')%></pre>

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:

<pre><%=$Server->HTMLEncode('
&matchtag( { param1 => "value1", param2=>"value2" }, \'text\' );
  -- and --
&matchtag( { param1 => "value1", param2=>"value2" }, \'\');
')
%></pre>

Note that XMLSubs tags of the form <my:ttb>foo:bar</my:ttb> will be changed into a
call to <my:ttb>&foo::bar()</my:ttb>, so that the XML concept of tag prefix
namespaces is translated to the concept of perl packages.
<p>

<my:table width=200 title="Title Box" border=3>
  <h3>XML Subs Demo</h3>

  Another table here to demo embedded XMLSubs tags:
  <my:table border=1>
    Double Table to Show Embedded Tags
  </my:table>

  <p>

  And another embedded:
  <my:table border=1>
    Another table.
      <my:table border=1>
        Triply embedded XMLSubs <my:ttb>my:table</my:ttb> table.
      </my:table>  
  </my:table>  

</my:table>
<p>

<% for("yellow", "red", "blue") { %>
	<my:table bgcolor=$_ width=200 title=ucfirst($_)."Box" border=5>
		Colored Box
	</my:table>
	<p>
<% } %>

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

<my:include src="footer.inc"/>



( run in 1.238 second using v1.01-cache-2.11-cpan-39bf76dae61 )