显示文件链接而不是实际内容
我现在正在编写一个 XQuery 脚本,作为 Oxygen XML 编辑器中的场景。它的工作原理基本上是连接到 XML 数据库,并抓取与用户输入相匹配的文件:
脚本的主要片段是:
for $book in collection("/db/portfolio/product?select=*.xml;recurse=yes")
return
<myFile>{$book[contains(article/@product,$product_code) and contains(article/title,$title)]}</myFile>
获得的结果始终是正确的,但它将始终显示生成的 xml 文件的实际内容(如果有的话)。但是,我想要的是显示一个带有文件名的链接,当用户单击它时,它将在 Oxygen XML 编辑器窗口中打开,用户可以在那里编辑内容。
我不确定这是 XQuery 问题还是 IDE 问题,我很想在这里听到建议,提前致谢。
I am now writing an XQuery script to work as an scenario in Oxygen XML editor. It basically works by connecting to an XML database, and grab the file that match the user's input:
The major fragment of the script is :
for $book in collection("/db/portfolio/product?select=*.xml;recurse=yes")
return
<myFile>{$book[contains(article/@product,$product_code) and contains(article/title,$title)]}</myFile>
The result obtained has always been correct, but it will always shows the actual content of the resulting xml file(if there is one). However, what I want is to show a link with the name of the file on it, when user clicks on it, it will open in the Oxygen XML editor window, and the user can edit the content there.
I am not sure whether this is an XQuery issue or the IDE issue, I would love to hear suggestions here, thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该尝试
fn:document- uri()
:You should try
fn:document-uri()
: