Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^7: Thanks to Ikegami, Chromatic & Corion

by Logicus
on Nov 02, 2011 at 02:37 UTC ( #935272=note: print w/ replies, xml ) Need Help??


in reply to Re^6: Thanks to Ikegami, Chromatic & Corion
in thread Thanks to Ikegami, Chromatic & Corion

Got it!

my %escapes = ( '&lab;' => '<', '&rab;' => '>', '&lcb;' => '(', '&rcb;' => ')', '&lsb;' => '[', '&rsb;' => ']' ); my $escapes_re = qr/&[lr][acs]b;/; $aXML =~ s/($escapes_re)/$escapes{$1}/g;


Comment on Re^7: Thanks to Ikegami, Chromatic & Corion
Download Code
Re^8: Thanks to Ikegami, Chromatic & Corion
by ikegami (Pope) on Nov 02, 2011 at 05:14 UTC

    That won't work. you need to handle those sequences, <special> and <post_include> at the same time, not before (which would break "&lab;special>lab&lab;/special>") or after (which would break "<special>lab</special>"). I've covered what would work elsewhere.

      But I can't think of any reason at all that you would need those sequences in the course of developing an aXML based system! They are pretty much for the plugins only, and the only use I've found for them so far is outputting complex litteral strings which contain aXML/Perl... a feature I've never needed until doing the PerlNights project.

      Look, why don't I email you over a copy of the the PerlNights build as it stands right now, and then you can have a look at a proper working aXML system that renders an output very similar to PerlMonks. Then you can see why I never really gave the specials much thought at all, because I never needed to.

        They are pretty much for the plugins only

        Yes, escape could very well be for plugins only. I was quite clear about what problem I was trying to fix.

        and the only use I've found for them so far is outputting complex litteral strings which contain aXML/Perl...

        Or just plain XML. Without these fixes, I wouldn't be able to use aXML for two of the three XML formats I deal with, and it would be very fragile for those with which I could use aXML.

        Re^8: Thanks to Ikegami, Chromatic & Corion could be seen as a continuation of this post.

        I was going to test <special> and &lab; and interactions between them, but aXML doesn't compile.

        $ perl -we'use aXML::Engine;' Can't locate Conf.pm in @INC (@INC contains: ...) at aXML/Engine.pm li +ne 4. BEGIN failed--compilation aborted at aXML/Engine.pm line 4. Compilation failed in require at -e line 1. BEGIN failed--compilation aborted at -e line 1.

        Don't you dare say it's something I need to provide.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://935272]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (14)
As of 2014-07-29 14:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (217 votes), past polls