【发布时间】:2019-01-02 18:09:19
【问题描述】:
我如何从撒克逊人fetch 远程XML?
thufir@dur:~/saxon$
thufir@dur:~/saxon$ java -cp /usr/share/java/Saxon-HE.jar net.sf.saxon.Query fetch.note.text.xq
Static error on line 2 at column 2 of file:/home/thufir/saxon/fetch.note.text.xq near {...ww.w3schools.com/xml/note.x...}
XPST0081: Namespace prefix 'fetch' has not been declared
Static error(s) in query
thufir@dur:~/saxon$
thufir@dur:~/saxon$ cat fetch.note.text.xq
fetch:xml("https://www.w3schools.com/xml/note.xml", map { 'chop': true() })
thufir@dur:~/saxon$
适用于BaseX。
简单的hello worldruns好的:
thufir@dur:~/saxon$
thufir@dur:~/saxon$ java -cp /usr/share/java/Saxon-HE.jar net.sf.saxon.Query test.xq
<?xml version="1.0" encoding="UTF-8"?><results><message>Hello World!</message></results>thufir@dur:~/saxon$
thufir@dur:~/saxon$
可能expath 提供这个functionality,也许?或者我应该将xslt 用于fetching。
【问题讨论】:
标签: java xml command-line-interface sax saxon