Invenzzia »

Pages: [1]   Go Down
  Print  
Author Topic: OPTv2: conditional prolog  (Read 609 times)
Description: Can the prolog instruction in a template be conditionally omitted?
0 Members and 2 Guests are viewing this topic.
whumble
User

Offline Offline

Posts: 10


View Profile
« on: March 01, 2011, 22:47:31 »

I use prolog instruction to set project encoding from variable,
but I'd like to skip prolog when sending a document to IE6
(to avoid IE6 quirk mode).
I found that constructions like
<opt:prolog  opt:if="$condition"/> don't work. Is there any solution to this problem?
Thanks.
Logged
Zyx
Your programmer
Administrator
User
*****
Offline Offline

Posts: 291



View Profile WWW
« Reply #1 on: March 02, 2011, 07:18:49 »

A bit strange. You could try the following:

Code:
<opt:if test="$condition">
  <opt:prolog />
</opt:if>
Logged

PozDrX, Zyx
---Invenzzia group---
whumble
User

Offline Offline

Posts: 10


View Profile
« Reply #2 on: March 02, 2011, 18:53:22 »

This doesn't work either, if prolog instruction is present anywhere within opt:root scope
the XML declaration will be sent to the browser unconditionally, I'm afraid.
Logged
Zyx
Your programmer
Administrator
User
*****
Offline Offline

Posts: 291



View Profile WWW
« Reply #3 on: March 03, 2011, 07:33:36 »

OK, I know what the problem is. The prolog is linked somewhere else in the internal template tree representation. The opt:prolog instruction links it right to that place, ignoring possible conditional instructions. I'll try to make a fix today for this.
Logged

PozDrX, Zyx
---Invenzzia group---
whumble
User

Offline Offline

Posts: 10


View Profile
« Reply #4 on: March 03, 2011, 20:44:43 »

Would be nice...
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Subject Started by Replies Views Last post
OPTv2: OPT 2.1 - ideas and proposals Zyx 0 959 Last post March 14, 2009, 22:57:23
by Zyx
OPTv2: Main tpl parced but opt:include view not parce amichelin 5 1969 Last post May 03, 2009, 16:03:37
by eXtreme
OPTv2: kod śledzenia Google Analytics poliman 3 533 Last post December 29, 2009, 19:48:00
by eXtreme
OPTv2: Problem po wyłączeniu konsoli chordspl 2 483 Last post July 06, 2011, 13:31:08
by chordspl
OPTv2: Widoczny prolog w trybie debug i blad wyswietlania strony bez niego. gorky_park 1 599 Last post October 30, 2009, 11:39:13
by Zyx