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