简体   繁体   English

使用XQuery,Zorba和Eclipse输出纯文本

[英]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.

相关问题 Eclipse将文件视为纯文本 - Eclipse treating file as plain text Eclipse Xquery用于复杂有效负载 - Eclipse Xquery For Complex payload Eclipse 中的 Java 编辑器就像一个纯文本编辑器 - Java Editor in Eclipse is acting like a plain text editor C ++ Eclipse控制台将纯文本编码为其他字符 - C++ Eclipse console encoding plain text as other characters 在 Eclipse 中,如何在默认文本编辑器中更改没有文件扩展名的纯文本文件的前景色和背景色? - In Eclipse, how do you change the foreground and background color in the default text editor for plain text files with no file extension? 停止Eclipse / Subversive在初始提交时将svn:mime-type设置为text / plain - Stop Eclipse/Subversive from setting svn:mime-type to text/plain on initial commit 在OSB项目中使用Xquery查找属性(使用Eclipse) - Find attribute with Xquery in OSB project (using eclipse) Spring 在 Eclipse 上输出 logo 和版本后启动应用程序突然停止 - Spring Boot application suddenly stops after outputing logo and version on Eclipse 如何在Eclipse C / C ++版中检查纯文本文件的拼写? - How can I check the spelling in plain text files in eclipse c/c++ edition? 我可以使用Eclipse XQDT调试Marklogic模块/ xquery吗? - Can I use Eclipse XQDT to debug Marklogic modules/xquery?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM