Firefox Wicket + Nitobi XHTML 命名空间解析错误
我在 XHTML 文档中使用多个 XML 命名空间时遇到问题。具体来说,我尝试在同一文档中使用 Wicket 和 Nitobi。
代码如下所示:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
xmlns:ntb="http://www.nitobi.com">
... blah blah blah ...
<wicket:extend>
<div wicket:id="gridContainer">
<wicket:panel>
<ntb:grid wicket:id="grid" id="grid14" width="660" height="600" mode="livescrolling">
</ntb:grid>
</wicket:panel>
</div>
</wicket:extend>
... blah blah blah ...
标头中还有调用 Nitobi 网格初始化代码的代码,该代码基本上尝试获取 ntb:grid XML。然而,当我使用 Firebug 单步执行初始化时,我发现 Firefox 在 XML 解析中出现以下错误:
Parsing Error: prefix not bound to a namespace
Location: http://localhost:8080/foo/bar
Line Number 1, Column 1:
<ntb:grid xmlns:ntb="http://www.nitobi.com" mode="livescrolling" height="600" width="660" id="grid14" wicket:id="grid">
</ntb:grid>
我做错了什么?我感觉这个问题与
标签如何嵌套在
标签中有关。
I'm having an issue using multiple XML namespaces in a XHTML document. Specifically, I'm trying to use Wicket and Nitobi in the same document.
The code looks something like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
xmlns:ntb="http://www.nitobi.com">
... blah blah blah ...
<wicket:extend>
<div wicket:id="gridContainer">
<wicket:panel>
<ntb:grid wicket:id="grid" id="grid14" width="660" height="600" mode="livescrolling">
</ntb:grid>
</wicket:panel>
</div>
</wicket:extend>
... blah blah blah ...
There is also code in the header that invokes Nitobi's grid initialization code which basically attempts to grab the ntb:grid XML. However, when I step through that initialization with Firebug, I see that Firefox pukes on the XML parsing with this error:
Parsing Error: prefix not bound to a namespace
Location: http://localhost:8080/foo/bar
Line Number 1, Column 1:
<ntb:grid xmlns:ntb="http://www.nitobi.com" mode="livescrolling" height="600" width="660" id="grid14" wicket:id="grid">
</ntb:grid>
What am I doing wrong? I have a feeling the issue has to do with how the <ntb>
tags are nested within the <wicket>
tags.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现该问题是由
ntb:grid
元素上的wicket:id
引起的。解决方法是从页面中删除wicket:
命名空间标记,如下所述:https://cwiki.apache.org/WICKET/how-to-remove-wicket-markup-from-output.html
以下是相关部分:
I discovered that the issue was being caused by having a
wicket:id
on thentb:grid
element. The workaround was to strip thewicket:
namespaced tags from the page as outlined here:https://cwiki.apache.org/WICKET/how-to-remove-wicket-markup-from-output.html
Here are the pertinent parts: