【问题标题】:How to declare XML namespaces when using conditional <html> tags使用条件 <html> 标签时如何声明 XML 命名空间
【发布时间】:2013-10-05 07:46:20
【问题描述】:

我正在尝试使用 JSF 来实现:

<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->

我找到了使用omnifaces o:conditionalComment 标记的示例——但我的问题是omnifaces 的声明是html 声明的一部分。

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:o="http://omnifaces.org/ui"
    xmlns:of="http://omnifaces.org/functions" >

【问题讨论】:

标签: jsf facelets conditional-comments omnifaces


【解决方案1】:

您可以在 &lt;f:view&gt; 中声明 XML 命名空间。

<f:view xmlns...>
    <html>...</html>
</f:view>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-04-24
    • 2015-11-25
    • 2011-01-27
    • 2023-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多