Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

That makes life a lot easier!

The only caveat I can think of is the refas plugin ie :

(refas tag="user")/path/to/user.xml(/refas) <p>Welcome back <user>username</user>, you were last here on : [time f +ormat="HH:MM:SS, DD/MM/YYY"]<user>lastvisit</user>[/time].</p>

Where <user> is not a known tag until refas creates a definition for it which maps the user tag data to the nodes in the user.xml file, and [time] takes an integer and gives back a formatted date/time string.

I was planning on expressing the difference between the three tag types by adding an attribute called aXML_class to the tags when converting them to standard XML :

(SQL mode="mask") <query> SELECT username,email FROM users; </query> <mask> [link action="showuser" username="<d>username</d>" ]<d>username</d>[/link], [link to="mailto:<d>email</d>"]<d>email</d>[/link] <br> </mask> (/SQL) Becomes : <SQL aXML_class="primary" mode="mask"> <query> SELECT username,email FROM users; </query> <mask> <link aXML_class="tertiary" action="showuser" username="<d>username</d>" ><d>username</d></link>, <link aXML_class="tertiary" to="mailto:<d>email</d>" ><d>email</d></link> <br> </mask> </SQL> Also when tags have tags embedded in their attributes like this : <a b="<c>d</c>">data</a> converting the expression to XML like this; <a aXML_class="standard"> <attr>b="<c aXML_class="standard">d</c>"</attr> <contents>data</contents> </a>

The examples above would map like this :

<SQL aXML_class="primary" mode="mask"> <query> SELECT username,email FROM users; </query> <mask> <link aXML_class="tertiary" action="showuser" username="<d>usern +ame</d>"><d>username</d></link>, <link aXML_class="tertiary" to="mailto://<d>email</d>"><d>email< +/d></link> <br> </mask> </SQL> becomes : my @nodes = ( Node->new( SQL => { aXML_class => 'primary', attr => { mode => "mask" }, contents => { '<query>SELECT * FRO +M users</query> <mask>', [ Node->new( link + => { aXML_class => 'tertiary', + attr => { action => 'showuser', + username => '<d>username<d>' }, + contents => '<d>username</d>' + } ), + + contents => '<d>username</d>' } ), Node->new( link + => { aXML_class => 'tertiary', + attr => { to => 'mailto://<d>email</d>' }, + contents => '<d>email</d>' + } ), ], '<br></mask>' } } ) ); and <a b="<c>d</c>">data</a> becomes : <a aXML_class="standard"> <attr>b="<c aXML_class="standard">d</c>"</attr> <contents>data</contents> </a> then becomes : my @nodes = ( Node->new( a => { aXML_class => 'standard', attr => { b => Node->new ( c => +{ aXML_class => 'standard', + contents => 'd' + } ) }, contents => 'data' } } ) );

In reply to Re^4: rough start of an axml compiler by Logicus
in thread rough start of an axml compiler 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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (6)
    As of 2014-10-02 05:01 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      What is your favourite meta-syntactic variable name?














      Results (49 votes), past polls