[英]Outputing plain text with XQuery, Zorba & Eclipse
I am attempting to get my head around using XQuery on a project im working on. 我正在尝试在正在处理的项目上使用XQuery。 One thing that I will need to do is use XQuery to parse an XML model and output plain text (this plain text will actually be C++ code, as the project is to create a XML -> C++ code generator).
我需要做的一件事是使用XQuery解析XML模型并输出纯文本(该纯文本实际上将是C ++代码,因为该项目是创建XML-> C ++代码生成器)。
It seems pretty straightforward to have it output HTML tags (as ive seen in most examples this is the likely use case for XQuery) by simply adding HTML into your code and surrounding XQuery commands in braces. 只需将HTML添加到您的代码中,并在花括号中加上XQuery命令,就可以输出HTML标签(在大多数示例中都已看到,这是XQuery的可能用例)非常简单。
Is it possible to do this but rather than have HTML just have plain text? 是否可以这样做,而不是让HTML仅包含纯文本?
Note: I am using eclipse with zorba for my XQuery development. 注意:我在XQuery开发中使用带有zorba的eclipse。
Cheers. 干杯。
Whether your XQuery outputs text, HTML, XML, or some other format (eg, JSON) is a matter of how you configure your query's serialization options. XQuery是输出文本,HTML,XML还是其他某种格式(例如JSON),这取决于如何配置查询的序列化选项。 It's usually as simple as declaring the output method and mimetype.
通常只需声明输出方法和mimetype。 Some XQuery implementations have their own serialization options syntax, and some use the W3C's XSLT and XQuery Serialization spec .
一些XQuery实现具有自己的序列化选项语法,而一些使用W3C的XSLT和XQuery序列化规范 。 This link in Zorba's documentation indicates that Zorba supports the options outlined in the formal spec.
Zorba文档中的此链接表示Zorba支持正式规范中概述的选项。
A somewhat dated thread , circa 2012, may offer some more specifics, but since I'm not a Zorba user, I can't give you more up to date suggestions than this. 一个大约过时的线程 ,大约在2012年,可能会提供一些更多细节,但是由于我不是Zorba用户,因此我无法为您提供最新的建议。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.