Posted by
Andrzej Jan Taramina-2 on
Dec 11, 2008; 8:21pm
URL: https://discuss.orbeon.com/Including-conditional-comments-in-your-XForm-tp41984p41985.html
Erik said:
> Unfortunately that's unlikely to work because the pipelines don't
> forward comments at the moment.
Then Ryan chimed in wtih:
> I agree, I prefer CSS over conditional includes, seems less of a hack and more of a solution to a problem that shouldn't exist
I agree that the problem shouldn't exist, but Microsoft and IE being the way they are, it does exist and thus has to be
dealt with until such a time when hell freezes over and MS decides to play nice and support standards. I'm not holding
my breath. ;-)
The solution for us was rather simple. We use a custom version of the OrbeonXFormsFilter and all our XForms flow
through it. We'ld already extended the this code to allow us to change base URLs, favicon references and other things
like that so that the resulting XForm was consistent with the rest of our web application.
So I just extended OrbeonXFormsFilter a bit further to allow it to perform arbitrary string substitutions on the
outbound xhtml (rendered XForm) returned by the Orbeon engine. The substitutions are defined in the web.xml file, and
ours looked something like this:
<filter>
<filter-name>orbeon-xforms-filter</filter-name>
<filter-class>com.chaeron.tomcat.filter.OrbeonXFormsFilter</filter-class>
<init-param>
<param-name>oxf.xforms.renderer.context</param-name>
<param-value>/orbeon</param-value>
</init-param>
<init-param>
<param-name>oxf.xforms.filter.substitute.from.ie6png</param-name>
<param-value>@@IE6-PNG@@</param-value>
</init-param>
<init-param>
<param-name>oxf.xforms.filter.substitute.to.ie6png</param-name>
<param-value><!--[if lte IE 6]><script type="text/javascript" src="./js/ie6-png.js"/>
</script><![endif]-->
</param-value>
</init-param>
</filter>
Then just put the string @@IE6-PNG@@ at the end of our XForm just prior to the <body> xhtml tag and voila....conditional
IE comments are rendered in the xhtml returned to the client browser.
You can specify any number of arbitrary string substitutions this way, in the web.xml file. You just have to make sure
the param name part after the from./to. (ie6png in the above example) matches up and is unique for every particular
substitution pair.
So now I don't much care if whether the problem should exist or not.....it's well and truly resolved, despite
Microsoft's best efforts. ;-)
--
Andrzej Taramina
Coalese Corporation: Knowledge that Acts!
http://www.coalese.com--
You receive this message as a subscriber of the
[hidden email] mailing list.
To unsubscribe: mailto:
[hidden email]
For general help: mailto:
[hidden email]?subject=help
OW2 mailing lists service home page:
http://www.ow2.org/wws