Saxon 8 - XQuery 文件 - Java 调用 [英] Saxon 8 - XQuery file - Java call

查看:61
本文介绍了Saxon 8 - XQuery 文件 - Java 调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我有这个错误:

Error on line 10 of *module with no systemId*:
  FODC0005: Exception thrown by URIResolver: Invalid relative URI
  {D:\Users\***\workspace\**...}: Illegal character in opaque part at index 2:
  D:\Users\***\workspace\***/JDPR/config/Rules.xml
Error at xsl:copy-of on line 13 of *module with no systemId*:
  FODC0005: Exception thrown by URIResolver: Invalid relative URI
  {D:\Users\***\workspace\**...}: Illegal character in opaque part at index 2:
  D:\Users\***\workspace\***/JDPR/config/Rules.xml
; SystemID: *module with no systemId*; Line#: 13; Column#: -1
net.sf.saxon.trans.DynamicError: net.sf.saxon.trans.DynamicError: Exception thrown by URIResolver
    at net.sf.saxon.functions.Document.makeDoc(Document.java:275)

与 XQuery 相关的部分是:

The XQuery part related is :

(:declare namespace dpr="java:util.DPRConfigurationLoader";:)
declare namespace dpr="java:com.*****.common.util.DPRConfigurationLoader";
declare variable $rules as node()* := doc(dpr:getApplicationProperty('Common','RulesFileLocation'))//category;

如果我按照此处所示运行此 xquery,则会出现错误.如果我取消注释第一行并注释第二行,则不会出现错误.

If I run this xquery as shown here it gives me the error. If I uncomment the first line and comment the second line the error does not appear.

在 Java 程序中,我修改了 Xquery 文件并删除了字符串com.*****.common".以便该行与注释行相同.

In the Java program I modify the Xquery file and delete the string "com.*****.common." so that the line becomes the same as the commented line.

所以我不明白为什么一个版本可以正常工作,而另一个在执行时是相同的,却没有.

So I don't understand why one version is working fine and the other, which is the same at the moment of execution, does not.

如果有人发现问题出在哪里... :-)

If someone find where is the problem... :-)

推荐答案

您正在提供一个 Windows 文件名 (D:\Users\***\workspace\**...} 到一个需要 URI 的接口.

You're supplying a Windows filename (D:\Users\***\workspace\**...} to an interface that expects a URI.

我不知道 dpr:getApplicationProperty() 是做什么的,但是如果它在不同的命名空间中有两个版本,那么它们可能会做不同的事情,所以一个成功并且其他失败.

I don't know what dpr:getApplicationProperty() does, but if there are two versions of it in different namespaces then they presumably do different things, so it's hardly surprising that one succeeds and the other fails.

doc() 函数的参数必须是 URI,而不是 Windows 文件名.

The argument to the doc() function must be a URI, not a Windows filename.

这篇关于Saxon 8 - XQuery 文件 - Java 调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆