Ok... here is an example, I haven't used this technique for a while but it has been useful before.

<refas tag="foo">/path/to/bar.xml</refas>

Where bar is an xml file containing some values, and refas creates a new plugin on the fly called foo, which substitutes any foo tags it finds in the document with the values they specify, adds it to the command list and restarts the parser.

Once that command is triggered, anywhere in the document that the tag <foo>x</foo> or <foo>y</foo> exists get substituted for the values contained in foo : <y>somevalue</y>, <x>somevalue</x>.

The <SQL tag supports a refas mode which uses the columns of the database for the key.

Another example is that it is possible to build tags on the fly for example :

<<qd>gettype</qd>> somedata </<qd>gettype</qd>>

Where gettype can be either html or xml, giving either:

<html> somedata </html> or <xml> somedata </xml>

If you can't determine ahead of time what a given tag actually means because it's meaning might be changed at runtime by another tag which branches on the request data, how can you compile it?


In reply to Re^5: hrm, Eval::Compile by Logicus
in thread hrm, Eval::Compile by Logicus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.