direct use of htp
January 4, 2008 - 3am Central time zone
Reviewer: Leo Van Nieuwenhuyse from Huizingen VB Belgium
do not use it directly...
use APEX to have it all generated for you...
Although I'm an Apex-lover, there are so many cases (eg. pl/sql portlet development in Oracle
Portal) where you need to use it directly.
I've been using them for more than 10 years, but I've also been discussing this topic with many
developers for as many years.
Personally I stick to the prn procedure (clarity of code, minimal overhead, ability to generate
xhtml, and last but not least: I just need to remember 1 and exactly 1 procedure to do the whole
job). And when you look at the code generated by loadpsp: except for the mime header - which of
course can't be generated using prn - it's just 1 procedure that is used: prn!.
But to broaden my view, any suggestions and points of view are welcome.
Followup January 4, 2008 - 11am Central time zone:
but that would be exactly what I said?
...
There is no way I would be writing htp.p calls today in 2007 - every now and then in a snippet of code in APEX maybe - but no, not seriously.
....
Happy New year
January 4, 2008 - 5am Central time zone
Reviewer: A reader from London
"There is no way I would be writing htp.p calls today in 2007". I think you mean 2008
Followup January 4, 2008 - 11am Central time zone:
indeed.

January 10, 2008 - 8am Central time zone
Reviewer: Alessandro Nazzani from Genoa, Italy
>>> do not use it directly...
>>> use APEX to have it all generated for you...
>> Although I'm an Apex-lover, there are so many cases (eg.
>> pl/sql portlet development in Oracle Portal) where you
>> need to use it directly.
> but that would be exactly what I said?
Mmmh... perhaps my English is not good enough, but to me it doesn't sound like *exactly* the same
thing...
Unfortunately sometimes (often?) ApEx is NOT an option.
> APEX uses the full suite of the API - the use htf.anchor and the like
Last time I checked, those API were printing all tags in uppercase, which destroys XHTML
compliance.
> Use of the primitive 'prn' procedure, allowing to write
> real xhtml tags, and minimizing subprogramm outlining?
>
> Use of the somehow 'higher level' 'p' or 'print' procedures,
> also allowing to write real xhtml tags, allowing to format
> date and number variables, but requiring some overhead?
I think htp.print (same as htp.p) and htp.prn are the same, with the exception that the latter does
NOT add a \n character. Am I wrong?
Alessandro
Followup January 10, 2008 - 2pm Central time zone:
what I said was:
.... There is no way I would be writing htp.p calls today in 2007 - every now and then in a snippet of code in APEX maybe ...
that is what you are saying - there are tiny snippets you'll use here and there - but it would be responsible for something like 1% of the HTML on a page.
p versus print versus print
January 11, 2008 - 5am Central time zone
Reviewer: Leo Van Nieuwenhuyse from Belgium
Allesandro, you're allmost right.
But the main difference between prn and p is not only the newline character but also the level of
the procedure:
prn itself is called again from p and print, so there's allways a little overhead:
your_procedure->htp.p->htp.prn
or
your_procedure->htp.print->htp.prn
|