in reply to Transforming axml into hyperlinks

How can one derive the string "someaction" from another string which doesn't contain it?

By magic, maybe?

Seriously, if "someaction" was contained anywhere in that weird XML string, it would be pretty trivial to get it out. But it isn't.

So, what exactly did you mean?

If you want to create a link based on the content of the string, say for instance action.pl?action=ref3 it's very simple. But the question as asked is pretty much unanswerable, as far as I can tell.



($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
=~y~b-v~a-z~s; print

Replies are listed 'Best First'.
Re^2: Transforming axml into hyperlinks
by simonodell (Acolyte) on Aug 27, 2007 at 20:03 UTC
    Ok, let me explain... first a quick recap the data available ;

    action.pl?ref=a%20link&ref2=ref3&ref3=someaction

    and the axml string:
    <link action="<qd><qd arg="(qd)ref3(/qd)">ref2</qd></qd>">[qd]ref[/qd] +</link>

    <qd> refers to a plugin which handles query data, and returns values from the query data hash... so if a qd command is given; <qd>ref3</qd> the result returned will be "someaction"

    as you can see through the example, the qd command is invoked several times before the link command, due to the heirachy of the tag types and their nesting. by the time the link command runs, all the qd's have done their thing, and the link command looks like ;
    <link action="someaction">a link</link>

    the example contained various levels of tags to try and illustrate how they can be used in conjunction with each other to build data on the fly, an ability which i extensively use (maybe abuse) in my work. I just noticed an error in the example which may well of obfuscated what i was trying to get at... bah!

    perhaps a better example would be just;
    <link action="<qd>ref3</qd>"><qd>ref</qd></link>


    which doesnt do anything funky with brackets but at least it works...

    the processing order would be;
    <qd>ref3</qd> ... result ; <link action="someaction"><qd>ref</qd></link> <qd>ref</qd> ... result ; <link action="someaction">a link</link> <link ... result ; <a href="action.pl?action=someaction">a link</a>


    I know this example is rather unexciting, but when you consider that any tag can become a handle for a plugin if a plugin is present with the same name, and that plugins can have any names then perhaps the idea starts to make some sense in a crazy naive way :)

    Anyway, i have dozens of plugins made covering a range of server side tasks like reading and writing xml files, to logging users in / out, retreiving session variables etc etc, all embeddable in a html document. the tag type things might be confusing to others but it seems so clear to me.. maybe im just looking at it from a skewed perspective as its author :)