我有一个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文件的输出中使用此模板?
提前致谢.