开发者

Does XSLT doc-available(string) not work for absolute paths?

开发者 https://www.devze.com 2023-03-18 09:12 出处:网络
I\'m using XSLT 2 (Saxon 9.x) with Java 开发者_如何学运维and having the following problem ...

I'm using XSLT 2 (Saxon 9.x) with Java 开发者_如何学运维and having the following problem ...

doc-available('file:///C:/Users/filename.xml') 

returns false

However ...

unparsed-text-available('file:///C:/Users/filename.xml') 

returns true

The file is a well-formed XML and exists.

If I use relative paths, then both functions return true. Also tried file:/C:/Users/filename.xml but with the same problem. I have also removed the Windows firewall, but that has no effect.

The same code works in Oxygen.


doc-available() can return false for two reasons: the file doesn't exist, or it can't be parsed as well-formed XML. You've eliminated the first possibility using unparsed-text; that leaves the second. I can't see any reason why a relative URI should work and not an absolute URI. (Well, actually I can, like the relative URI is actually fetching the file from a different location than the absolute URI.)

Essentially there are so many variables affecting the outcome that it's very hard to tell you what the cause is in your particular case.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号