如何使用可解析的基本引用调用 xpath document()
我有一个 xml 文件,其中包含另一个 xml 文件的名称:
在我的样式表中,我检测到 @href 并通过 document() 函数打开文档 document
(@href)
应该 使用“Base URI of the计算第一个参数的字符串的节点”
document(@href,.)
应该 使用“当前节点的基本 URI”的基础调用我的 URIResolver.resolve(fname,base)
然而,在实践中,Xalan/J
文档(@href)
是空白的
,
文档(@href,.)
给出了我的应用程序的当前目录
如何设置基数以便我的 URIResolver 可以找到该文件?
I have an xml file which contains the name of another xml file:
within my stylesheet, I detect @href and open the document via the document() function
document(@href)
should call my URIResolver.resolve(fname,base) with base of the "Base URI of the node from which the the string of the first argument is calculated"
document(@href,.)
should call my URIResolver.resolve(fname,base) with base of the "Base URI of the current node"
However in practice with Xalan/J
document(@href)
is blank
and
document(@href,.)
is giving current directory of my application
How do I set base so that my URIResolver can find the file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请注意,这
与此相同
,因此也可能与
From http://www.w3.org /TR/xslt#document:
进而
但这:
将使用样式表 URI 作为解析器。因为:
进而
关于问题
答案:使用第二种形式和@xml:base
Do note that this
It's equal to this
and so maybe also to
From http://www.w3.org/TR/xslt#document:
And then
But this:
Will use the stylesheet URI as resolver. Because:
And then
About the question
Answer: use the second form and @xml:base