意外的字符“!”错误xpath
我打算使用xquery/xpath环境生成一个HTML5页面...下面是我的页面模板功能。
(: 显示页面:) 声明函数 mobunpage:display-page($pageinfo as element()) as element() { ; {mobunpage:get-head($pageinfo)} <正文> {mobunpage:get-foot($pageinfo)} 然后
我得到错误:
“加载模块mobunpage时发现错误:从modules/mobunpage.xqm加载模块时发现错误:意外的字符:'!'”
我正在eXist XML数据库上运行并且当我添加没有文档类型的页面时出现上述错误,页面工作正常并显示解析的变量。任何人都知道如何解决此类错误。转义并不能解决问题,并尝试了文档中的几个功能(http://www.w3.org/TR/xpath-functions/),但到目前为止没有运气。一定会感谢一些帮助。谢谢!
I intend to generate a HTML5 page using xquery/xpath environment... Below is my page template function.
(: Displays the page :)
declare function mobunpage:display-page($pageinfo as element()) as element() {
<!DOCTYPE HTML >
<html>
{mobunpage:get-head($pageinfo)}
<body>
{mobunpage:get-foot($pageinfo)}
</body>
</html>
};
And with that I get and error:
"error found while loading module mobunpage: error found while loading module from modules/mobunpage.xqm: unexpected char: '!'"
I am running on an eXist XML database and getting the above error which comes when i add the without the doctype the page works fine and display the parsed variables. Anyone know how to go about such error. Escaping doesn't solve the problem and tried a couple of functions from the documentation(http://www.w3.org/TR/xpath-functions/) but with no luck so far. Will definitely appreciate some help. Thankies!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不是有效的 XQuery 语法。
如果您的 XQuery 引擎支持序列化选项的定义,那么将有选项 doctype-system 和 doctype-public 来设置生成的 XML/HTML 的系统 ID 和公共 ID。它不太可能支持新语法,但您应该能够使用替代的 doctype-system="about:legacy-compat",如冗长的线程 使用 XSLT 设置 HTML5 文档类型
The
<!DOCTYPE HTML >
isn't valid XQuery syntax.If your XQuery engine supports definition of serialization options then there will be options doctype-system and doctype-public to set the system ID and public ID of the generated XML/HTML. It's unlikely it will support the new syntax, but you should be able to use the alternative doctype-system="about:legacy-compat" as described in the lengthy thread Set HTML5 doctype with XSLT