in reply to Re^5: more bracket chaos
in thread more bracket chaos

(session add="username")<qd>username</qd>(/session)
would result in the string "<qd>username</qd>" getting added to the session data under the tag username. this wouldnt happen with [ses<qd , <ses<qd or <ses(qd which would all work fine... <ses[qd would also break however [ses[qd and [ses(qd would work fine.

its hard to think up examples of incorrect nesting, typically the brackets will all be < type and the normal nesting follows, the other two are just special cases where some bits of code have to be run out of the normal order. for instance a plugin to manipulate a server side file prior to allowing another plugin to read it and display its contents. (btw i got some nice caching on my implementation to avoid unneeded server disk writes) additional ; another thought;
<case c="<mem>ref</mem>"> <1> (insertfile... </1> <2> (deletefile... </2> </case>
this case statement does both cases before deciding which to do! if you turn the brackets around and give (case(mem, it works correctly.

Replies are listed 'Best First'.
Re^7: more bracket chaos
by ikegami (Patriarch) on Aug 30, 2007 at 18:04 UTC
    Why can't session get the username from the same place as qd does? It's really weird that it needs to be converted to ML and then back to a string.
      the modules are designed to work as independantly of each other as possible, the session var could be told
      <session add="foo"><qd>bar</qd></session> or <session add="foo"><case c="<qd>bar</qd>"> <refa>something</refa> <refb>something else</refb> </case></session> or <session <qd>ses_action</qd>="foo">some data</session> where ses_action is one of ; add ; del ; append etc
      </code>

        Ok, I'll grant you that your model requires them. I'll stop here before I say something non-constructive.