So, we need to find a solution that will: 1. maintain backward compatibility (not breaking the ones without space after <?) 2. co-exist with other "<?" usages (like <?xml) 3. not need users to recompile Rivet or write code
My suggestion would be to: Make the start and end tags to be run-time configurable through directives while keeping the old usage of "<? (without space)" to be the default behavior. This, in addition to above, will give freedom for the users to choose the tags. Best Regards, Nagu. On Wed, Jul 25, 2012 at 10:33 PM, Damon Courtney <da...@tclhome.com> wrote: > It was just the tag that everyone else had sort of arbitrarily decided was > the default. Since Apache wouldn't let you pass any given file through > more than one handler (by mime type), it wasn't important to distinguish it > from PHP and others. I suppose we could have made the parser look for a > space after the <? to avoid stuff like this, but honestly, it never came up > until now. To do so now would break backward compatibility, even though I > doubt many use <? without a trailing space. > > Basically, any answer other than a workaround, at this point, is going to > break backward compatibility. I'm not a fan of that when there's no good > reason and a workaround. We can argue all day about what SHOULD have been > done 10 years ago, and I might even agree with you, but the point is that > it's done now and has been in use for a decade. > > Love the <?= addition by the way, Jeff. I had faked that in some other > app I wrote a while back, and it's nice to see it "officially" supported. > 0-] > > > On Jul 25, 2012, at 4:30 AM, Massimo Manghi wrote: > > > Adding a switch to provide support for <?rvt ?> with a compatibility > mode for the current escaping style should be feasible but it definitely > would bring confusion to the current status of code written with Rivet. > Still I think Nagu's objection is sensible, Rivet probably had a better > choice if the <?rvt.... ?> escaping style had been followed, that's why I > called for David and Damon opinion. They had a better insight in it > > > > -- Massimo > > > > On 2012-07-25 7:24, Jeff Lawson wrote: > >> If you wanted to be even fancier, you could do this to automatically > >> set the Content-Type header based on that XML declaration: > >> > >> proc xml {args} { > >> set contentType "text/xml" > >> foreach onearg $args { > >> if {[regexp {^encoding="(.*)"$} $onearg - charset]} { > >> append contentType "; charset=$charset" > >> break > >> } > >> } > >> headers type $contentType > >> puts "<?xml [join $args] ?>" > >> } > >> > >> On Wed, Jul 25, 2012 at 12:05 AM, Jeff Lawson <j...@bovine.net [12]> > >> wrote: > >> > >>> Technically, Rivet doesnt validate the character that immediately > >>> follows <?, other than ensuring it is not <?= > >>> > >>> The "xml" that immediately follows the opening sequence is being > >>> executed as the command name. You dont even need to modify the > >>> source to Rivet itself to define a proc in the global init script > >>> that was like this: > >>> > >>> <? > >>> proc xml {args} { > >>> puts "<?xml [join $args] ?>" > >>> } > >>> ?> > >>> > >>> Then when Rivet encounters this sequence, it would execute the "xml" > >>> proc and just output the tag as you intended. > >>> > >>> <?xml version="1.0" encoding="UTF-8"?> > >>> > >>> On Tue, Jul 24, 2012 at 11:51 PM, Nagarajan Chinnasamy > >>> <nagarajanchinnas...@gmail.com [11]> wrote: > >>> > >>>> Leaving aside what php does with this tag, isnt it a good practice > >>>> for any template engine to *emit* the patterns that it does not > >>>> recognize? > >>>> > >>>> I dont know how <? tag is tokenized in Rivet. If we say, Rivet > >>>> recognizes the patterns "<?" and "<?=", then any other pattern of > >>>> "<?xxxx" should be emitted out as is....IMHO > >>>> > >>>> Best Regards, > >>>> Nagu. > >>>> > >>>> On Mon, Jul 23, 2012 at 12:11 PM, Jeff Lawson <j...@bovine.net > >>>> [10]> wrote: > >>>> > >>>>> As you know, the "<?" tag is also used by PHP (in its default > >>>>> short tag mode), so Rivet is not unique in choosing it. In any > >>>>> case, the choice was already made for the project long ago. > >>>>> > >>>>> You can also compile Rivet to use different tags if you really > >>>>> want to make your configuration even more non-standard... :) > >>>>> > >>>>> -DSTART_TAG="<?" -DEND_TAG="?>" > >>>>> > >>>>> On Sun, Jul 22, 2012 at 11:08 PM, Nagarajan Chinnasamy > >>>>> <nagarajanchinnas...@gmail.com [9]> wrote: > >>>>> > >>>>>> Thanks Massimo & Jeff. > >>>>>> > >>>>>> However, from a users perspective, my take on this issue is > >>>>>> that Rivet should not hijack the entire "<?" tag to itself, > >>>>>> especially when "<?xml" is a widely-used standard practice. > >>>>>> Even before its sent to tcl interpretter, why not just emit > >>>>>> the whole tag when its not recognized by rivet? As it was > >>>>>> suggested, having a "<?rivet" tag may also help. > >>>>>> > >>>>>> This point leads me to the imagination of having a template > >>>>>> that has all different things embedded (xml, tcl code, php > >>>>>> code etc.). This may need a super-template-processing-module > >>>>>> as an apache module that dispatches a <?xxx block to the right > >>>>>> template-processing-module based on configuration directives. > >>>>>> > >>>>>> Best Regards, > >>>>>> Nagu. > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: rivet-dev-unsubscr...@tcl.apache.org > > For additional commands, e-mail: rivet-dev-h...@tcl.apache.org > > > >