实际上可以从 CLI 运行 xquery 吗? [英] can xquery be run practically from the CLI?

查看:64
本文介绍了实际上可以从 CLI 运行 xquery 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

灵感来自 zx485 的回答:

<块引用>

检查单独的 libxslt 页面

XSL 转换,是一种将 XML 文档转换为其他 XML 文档(或 HTML/文本输出).

一个名为 libxslt 的独立库可用于实现 XSLT-1.0对于 libxml2.这个模块libxslt"也可以在 Gnome SVN 中找到基础.

您可以在 libxslt 更新日志上查看进度.

丹尼尔·维拉德

http://xmlsoft.org/XSLT.html

解决方案

你可以像 这个详尽的教程.

总结一下,将 XQuery 代码复制到一个文件(此处命名为 test.xq),然后使用(当前版本的)Saxon 执行它:

java -cp saxon9he.jar net.sf.saxon.Query test.xq

示例案例中的输出是

<message>Hello World!</message></结果>

根据需要.

How is this sample xquery executed from the CLI?

xquery version "1.0";
let $message := 'Hello World!'
return
<results>
   <message>{$message}</message>
</results>

Inspired from zx485's answer:

Check the separate libxslt page

XSL Transformations, is a language for transforming XML documents into other XML documents (or HTML/textual output).

A separate library called libxslt is available implementing XSLT-1.0 for libxml2. This module "libxslt" too can be found in the Gnome SVN base.

You can check the progresses on the libxslt Changelog.

Daniel Veillard

http://xmlsoft.org/XSLT.html

解决方案

You can do it with Saxon like in this extensive tutorial.

To summarize it, copy the XQuery code to a file (here named test.xq) and then execute it with (the current version of) Saxon:

java -cp saxon9he.jar net.sf.saxon.Query test.xq

The output in your sample case would be

<results>
    <message>Hello World!</message>
</results>

as desired.

这篇关于实际上可以从 CLI 运行 xquery 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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