小编use*_*473的帖子

eXist-db在.xq数据中包含html模板

我有一个index.html数据,我通过以下方式包含模板:

<div xmlns="http://www.w3.org/1999/xhtml" data-template="templates:surround" data-template-with="templates/page.html" data-template-at="content">
Run Code Online (Sandbox Code Playgroud)

在索引html网站上我添加了一个关键字搜索表单,我的想法是,当我点击搜索按钮时,它应该调用.xq文件来请求搜索结果:

<form method="GET" action="ksearch.xq">
Run Code Online (Sandbox Code Playgroud)

当我提交表单时,会打开ksearch.xq页面,但即使我包含与上面相同的模板div:

<div xmlns="http://www.w3.org/1999/xhtml" data-template="templates:surround" data-template-with="templates/page.html" data-template-at="content">
Run Code Online (Sandbox Code Playgroud)

ksearch.xq页面没有应用模板.

似乎当我调用.xq文件时,模板未应用,但是当我调用纯HTML文件时,模板将被应用.

所以问题是如何在.xq文件的输出中使用此模板?

提前致谢.

html templates xquery exist-db

3
推荐指数
1
解决办法
341
查看次数

标签 统计

exist-db ×1

html ×1

templates ×1

xquery ×1